News:

Support the VirtueMart project and become a member

Main Menu

Recent posts

#41
Administration & Configuration / Shopping cart errors Bootstrap...
Last post by Margriet - September 26, 2024, 09:54:26 AM
Missing language constants, wrong language constants and wrong language
See images
#42
General Questions / Re: Disable Show Children Cate...
Last post by Ghost - September 26, 2024, 09:26:46 AM
Manufacturer's products page is category view. Files in com_virtuemart/views/category/tmpl/.
#43
General Questions / Re: Disable Show Children Cate...
Last post by joozen - September 26, 2024, 09:20:07 AM
Can enyone advise please at least where to look into it. Probably some code to comment? I tried manufacturers view but no luck.
#44
Plugins: Payment, Shipment and others / Problem with conversion tracki...
Last post by souacz53 - September 25, 2024, 18:21:30 PM
Hi, I have a problem with correct tracking of conversions after a purchase using przelewy24.

In the plugin settings I can add GA Key and after each successful purchase information about the transaction is sent to Google. The problem is with placing the conversion code in the page code.

After the purchase, the code instead of remaining hidden, is displayed after the message about the correct course of the transaction. Moreover, it is not correct code, it is text, not enclosed in "<script>" tags, just simple text.

I see in the plugin's php file that the "ga_script" variable is placed right after the message about a correct transaction, but I can't correct the code so that the correct script is placed in the page source and is not visible to the page user.

Here is the code that places the function in the code (search for "ga_script"):
// success
        $order_id = JRequest::getString('on');

        if (!empty($order_id)) {
            $db = JFactory::getDBO();
            $order_id = addslashes($order_id);
            $db->setQuery('SELECT p24.*, ord.order_status, ord.virtuemart_order_id FROM ' . $this->_tablename . ' as p24 JOIN `#__virtuemart_orders` as ord using(virtuemart_order_id) WHERE p24.order_number="' . $order_id . '"');
            $payment_db = $db->loadObject();

            if(!$payment_db)
                return null;

            $modelOrder = VmModel::getModel('orders');
            $order = $modelOrder->getOrder($payment_db->virtuemart_order_id);
            if (!($method = $this->getVmPluginMethod($order['details']['BT']->virtuemart_paymentmethod_id)))
                return null;

            if ($payment_db->order_status == 'C') {
                $ga_script = '';
                if (strlen($method->key_ga)) {
                    $ga_script = $this->generateGoogleAnalyticsTrackingCode($order_id, $order, $method);
                }
                JFactory::getApplication()->enqueueMessage(JText::_('PLG_PRZLELEWY24_SUCCESS') . $ga_script);
            } elseif ($payment_db->order_status == 'X') {
                JError::raiseWarning(100, JText::_('PLG_PRZLELEWY24_FAIL'));
                JFactory::getApplication()->enqueueMessage(JText::_('PLG_PRZLELEWY24_FAIL'));
            } else {
                $this->changeOrderStatus($payment_db->virtuemart_order_id, 'I', JText::_('PLG_PRZLELEWY24_WAITING'), $method->mail);
                JFactory::getApplication()->enqueueMessage(JText::_('PLG_PRZLELEWY24_WAITING'));
            }
        }

And this is the function definition (search for "ga_script"):
private function generateGoogleAnalyticsTrackingCode($order_id, $order, $method)
    {
        $categoryModel = VmModel::getModel('Category');
        $currency = $this->getCurrencyCodeById($order['details']['BT']->order_currency, $method);
        $shopName = JFactory::getConfig()->get('sitename');
        $total = $method->ga_gross_price == 1 ? $order['details']['BT']->order_total : $order['details']['BT']->order_subtotal;
        $transaction = <<<HTML
                                ga('ecommerce:addTransaction', {
                                  'id': '{$order_id}',
                                  'affiliation': '{$shopName}',
                                  'revenue': '{$total}',
                                  'shipping': '{$order['details']['BT']->order_shipment}',
                                  'tax': '{$order['details']['BT']->order_tax}',
                                  'currency': '{$currency}'
                                });
HTML;

        $products = $order['items'];
        $items = '';
        if (is_array($products)) {
            foreach ($products as $product) {
                $category = $categoryModel->getCategory($product->virtuemart_category_id);
                $productTotal = $method->ga_gross_price == 1 ? $product->product_final_price : $product->product_priceWithoutTax;
                $items .= <<<HTML
                                    ga('ecommerce:addItem', {
                                        'id': '{$order_id}',
                                        'name': '{$product->order_item_name}',
                                        'sku': '{$product->order_item_sku}',
                                        'category': '{$category->category_name}',
                                        'price': '{$productTotal}',
                                        'quantity': '{$product->product_quantity}',
                                        'currency': '{$currency}'
                                      });
HTML;
            }
        }

        $ga_script = <<<HTML
                            <script>
                              (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
                              (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
                              m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
                              })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

                              ga('create', '{$method->key_ga}', 'auto');
                              ga('require', 'ecommerce');
                              {$transaction}
                              {$items}
                              ga('ecommerce:send');
                            </script>
HTML;

        return $ga_script;
    }

I haven't changed anything in this plugin, this is the original state. The plugin's creator has dematerialized and I have no way of contacting him. Hence the request for help from the VM community.
#45
General Questions / Switch currency with language
Last post by VB74 - September 25, 2024, 10:00:15 AM
Hello everybody,

I use VirtueMart 4.2 and Joomla 5  : https://casa-bandera.com/

I would like to know if it possible to switch currency with selected language?

Example :

  • English -> Dollar
  • French or Italian -> Euro

Thanks in advance!
#46
Virtuemart Development and bug reports / Re: Bug on child product delet...
Last post by AlfredJK - September 24, 2024, 21:19:41 PM
delete the cookies and it works again. Problem here was the recently viewed products
#47
Virtuemart Development and bug reports / Re: Bug on child product delet...
Last post by AlfredJK - September 24, 2024, 15:27:27 PM
In version 4.2.18 11050, the bug is still present. Both the parent and child record are not present in the database. Does anyone have an idea how to fix the problem?
#48
General Questions / Paid status is wrongly set to ...
Last post by amlil71 - September 24, 2024, 15:09:43 PM

Hello i open a new ticket about this problem : https://forum.virtuemart.net/index.php?topic=143408.0

I have an error message when i try to update the status of orders in Virtuemart since virtuemart 4.2.2.

I am the only one to have this issue. I have 2 eshop with virtuemart and in the 2 eshop i have this problem.

I try to debug but i have no indication in log files.

How can i debug and have moreinformation about this bug ?

Thank you for your help.
#49
Administration & Configuration / Search by manufacturers
Last post by hegbi - September 24, 2024, 12:44:26 PM
Hello, is it possible that you add search products by manufacturers to the core?

This option was present in configuration in VM3 but there is no checkbox for manufacturers in VM4.2

J5.1.4 / V4.2.18 11050
#50
Administration & Configuration / Re: Paid status is wrongly set...
Last post by amlil71 - September 23, 2024, 22:32:19 PM
Hello, i have installed virtuemart 4.2.18 and i have also this error message with x when i try to change order status. I have tried ti debug but there is no error message explantion about this issue.
Since Virtuemart 4.2.0 i can't make updates i have always this message which not allow order to change status...

Do you have any idea to resolve it ?