VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: fatelettronica on November 01, 2025, 20:13:43 PM

Title: Checkout stuck issue
Post by: fatelettronica on November 01, 2025, 20:13:43 PM
I've encountered a major issue on three managed sites. This past week, I updated to VirtueMart version 4.6.0 11214.
The update went well until I saw users having trouble completing their orders. I ran a test, and the problem is that the error message "Invalid Token, in view=cart task=updatecart" appears. It's not possible to proceed with the order.

Regards

Joomla! 5.4.0
PHP version 8.4.5
Title: Re: Checkout stuck issue
Post by: fatelettronica on November 01, 2025, 20:14:10 PM
I've now solved the problem by reloading VirtueMart 4.4.10 11120
Let me know if the problem is resolved in version 4.6.0.
Title: Re: Checkout stuck issue
Post by: Milbo on November 04, 2025, 17:04:39 PM
Thank you for reporting this problem.

I added a plugin to solve the problem with the token https://docs.virtuemart.net/tutorials/templating-layouts/fix-missing-token-in-checkout-virtuemart-4-6-x

But we also released a new version, which has it as option in the vmconfig among the legacy settings.
Title: Re: Checkout stuck issue
Post by: fatelettronica on November 07, 2025, 17:20:01 PM
Hi,
I tried the latest version 4.6.2, but nothing changed. I still see that the cart doesn't work.
I see that I can't change the product quantity.

I read the blog and tried enabling "Add Token to Cart," but it doesn't work.
Disabling "Use current shop template overrides" is horrible.
I can't edit the Default.php file to add a string because the file is a Virtuplanet override.
I'm still using 4.4.0.
Title: Re: Checkout stuck issue
Post by: ViPeS on November 07, 2025, 18:12:13 PM
Quote from: fatelettronica on November 07, 2025, 17:20:01 PMI tried the latest version 4.6.2, but nothing changed. I still see that the cart doesn't work.
I see that I can't change the product quantity.

I can't edit the Default.php file to add a string because the file is a Virtuplanet override.

What VirtuePlanet template are you using?
I have VP Neoteric 2.4 and VM 4.6.2 11221, Joomla 5.4.0.

The cart is working.
But the VP Prime Mini Cart is used.
https://virtuvinis.lt/en/shop/categories/sinks-and-washbasins/blanco_sink/blanco-dalago/blanco-dalago-45-anthracite-517156-detail
Title: Re: Checkout stuck issue
Post by: fatelettronica on November 11, 2025, 10:45:27 AM
Hi,
The template I'm using is VP Merchant.
I received this reply from Jumbo in the VirtuePlanet forum.

The current version of the template is not fully compatible with VirtueMart 4.6.x. We are working on it and we will release the update soon. Until then, you can reinstall VirtueMart 4.4.10.
Title: Re: Checkout stuck issue
Post by: Voronn on April 24, 2026, 14:27:23 PM
Hello VirtueMart Team,
I would like to report a critical issue in the PayPal Checkout plugin (version 4.6.4).
Problem description:
When third-party cookies are blocked in the browser, the file site.js generates a massive number of repeated network requests (hundreds within seconds). This leads to severe performance degradation, high CPU usage, and browser slowdown.
Technical cause:
Inside Virtuemart.onReadyPP, there is a setInterval loop running every 100ms. While the PayPal SDK is not available (typeof paypal === "undefined"), the code repeatedly calls:

fetch(vmPP.nvpUrl)

This results in continuous network requests until the timeout is reached (up to 60 seconds). If the SDK cannot load (e.g., due to blocked third-party cookies), this becomes an uncontrolled request loop.

Impact:

Hundreds/thousands of unnecessary requests
High CPU usage
Browser slowdown and fan activity
Poor user experience, especially on checkout pages

Temporary fix applied:
I removed the call to fetchButtonSDK() from inside the interval loop. After this change, the issue disappears completely, and the checkout works normally.

Suggested fix:

Do not perform network requests inside a high-frequency interval
Retry logic (if needed) should be limited and not run continuously
Handle the case where PayPal SDK fails to load (e.g., due to browser privacy settings) gracefully

Environment:

VirtueMart: 4.6.4
PayPal Checkout plugin: 4.6.4
Browser: Firefox (issue reproducible with third-party cookies blocked)
Please review this behavior, as it can significantly affect site performance and user experience.

I changed last:
Virtuemart.onReadyPP = function () {

    if (vmPP.debug == '1') {
        console.log("with vmPPStyle, vmPP", vmPPStyle, vmPP);
    }

    if (
        vmPP.products.indexOf('buttons') >= 0 ||
        vmPP.products.indexOf('hosted-fields') >= 0 ||
        vmPP.products.indexOf('pui') >= 0
    ) {

        var paypalCheckAttempts = 0;
        var paypalMaxAttempts = 300; // 30 seconds

        killme = setInterval(function () {

            paypalCheckAttempts++;

            if (typeof paypal === "undefined") {

                if (vmPP.debug == '1') {
                    console.log("PayPal SDK not loaded yet");
                }

                if (paypalCheckAttempts >= paypalMaxAttempts) {
                    clearInterval(killme);
                    clearTimeout(finalPunisher);
                    console.log("PayPal SDK not loaded, stopped checking");
                }

                return;
            }

            clearInterval(killme);
            clearTimeout(finalPunisher);

            if (vmPP.debug == '1') {
                console.log("Paypal loaded");
            }

            if (vmPP.vmPPOrderId == "" && vmPP.products.indexOf('buttons') >= 0) {

                if (vmPP.debug == '1') {
                    console.log("Paypal buttons loaded");
                }

                if (vmPP.withButton == "true") {
                    Virtuemart.renderPayPalButtons("#paypal-button-container");
                }

                if (vmPP.withLogin == "true") {
                    Virtuemart.renderPayPalButtons("#paypal-button-login");
                }
            }

            if (
                vmPP.products.indexOf('hosted-fields') >= 0 &&
                vmPP.selected == 'hosted-fields'
            ) {
                if (vmPP.debug == '1') {
                    console.log("Paypal hosted-fields loaded");
                }

                jQuery('.card_container').hide();
                Virtuemart.renderPayPalCredit();
            }

            if (vmPP.products.indexOf('pui') >= 0) {
                if (vmPP.debug == '1') {
                    console.log("Paypal PUI loaded");
                }

                Virtuemart.renderPUI();
            }

        }, 100);

        finalPunisher = setTimeout(function () {
            clearInterval(killme);
            console.log("Loading Buttons killed");
        }, 30000);
    }
};

});

Best regards