Viewing 8 replies - 1 through 8 (of 8 total)
  • James

    (@outrankjames)

    Are you running Stripe too by any chance?

    We’ve just noticed a bug that stops people checking out if Stripe payment gateway is activated

    Thread Starter maco272

    (@maco272)

    no we dont use Stripe or another payment module, only the default COD and bank transfer

    Plugin Support Luiggi B.

    (@luiggiab)

    Hello @maco272

    It looks like there is a plugin modifying that area. Please perform a conflict test to identify which plugin may be causing the issue.

    This error is probably a conflict between plugins, so it would be helpful if you could run a plugin conflict test to find out which plugin or theme might be conflicting with Fluid Checkout.

    Basically, you temporarily deactivate all plugins except for WooCommerce and Fluid Checkout, then re-activate each plugin one by one until you find one that causes the issue. Ideally this should be done in a test/staging copy of your website. You can find more specific instructions in the article below from WooCommerce:
    https://docs.woocommerce.com/document/how-to-test-for-conflicts/

    Once we know what plugin or theme is causing this compatibility issue with Fluid Checkout, then we can work on fixing it.

    For now, reverting to the older version could be a temporary fix. Please do so using the following link: fluid-checkout-4.2.4.zip

    @outrankjames Please open a new ticket with information on how to replicate the issue, and also perform a conflict test. This will help us organize the different issues into separate tickets.

    Kind regards,
    Luiggi

    Hi,

    I investigated this issue and, at least in this case, it is not caused by Stripe.

    I can reproduce the same infinite loading problem with Stripe disabled and Mercado Pago enabled. The browser console shows:

    Uncaught TypeError: Cannot read properties of undefined
    (reading '__maybeHideDefaultButtonOnInit')

    The error happens inside Fluid Checkout 4.2.5:

    wc.customPlaceOrderButton.__maybeHideDefaultButtonOnInit(
        $selectedMethod.val()
    );

    Fluid Checkout 4.2.5 replaces WooCommerce’s wc-checkout script. However, when it registers its replacement script, it does not include:

    wc-custom-place-order-button

    as a dependency.

    WooCommerce’s original wc-checkout script includes this dependency. Because Fluid Checkout removes it, window.wc exists but wc.customPlaceOrderButton is undefined.

    This causes the JavaScript execution to stop inside init_payment_methods(), before the selected payment method click event is triggered. As a result, payment gateways such as Mercado Pago do not finish initializing and the loading spinner remains visible indefinitely.

    Therefore, this is not specifically a Stripe issue. Stripe may also trigger or expose the problem, but the root cause is the missing script dependency in Fluid Checkout 4.2.5.

    The permanent fix in Fluid Checkout should be to add wc-custom-place-order-button to the dependencies of the replacement wc-checkout script:

    wp_register_script(
        'wc-checkout',
        $this->get_script_url( 'js/checkout' ),
        array(
            'jquery',
            'woocommerce',
            'wc-country-select',
            'wc-address-i18n',
            'wc-custom-place-order-button',
            'fc-utils',
        ),
        null,
        array(
            'in_footer' => true,
            'strategy'  => 'defer',
        )
    );

    It would also be safer to check that the object exists before calling it:

    if (
        window.wc &&
        wc.customPlaceOrderButton &&
        $selectedMethod.length
    ) {
        wc.customPlaceOrderButton.__maybeHideDefaultButtonOnInit(
            $selectedMethod.val()
        );
    }

    As a temporary workaround, site owners can add the following code to the child theme’s functions.php:

    /**
     * Temporary fix for the missing Fluid Checkout 4.2.5 dependency.
     */
    add_action( 'wp_enqueue_scripts', function () {
        if (
            is_admin()
            || ! function_exists( 'is_checkout' )
            || ! is_checkout()
        ) {
            return;
        }
    
        $scripts = wp_scripts();
    
        if (
            ! isset( $scripts->registered['wc-checkout'] )
            || ! wp_script_is(
                'wc-custom-place-order-button',
                'registered'
            )
        ) {
            return;
        }
    
        $checkout_script = $scripts->registered['wc-checkout'];
    
        if (
            ! in_array(
                'wc-custom-place-order-button',
                $checkout_script->deps,
                true
            )
        ) {
            $checkout_script->deps[] =
                'wc-custom-place-order-button';
        }
    
        wp_enqueue_script( 'wc-custom-place-order-button' );
    }, 99 );

    After adding the workaround, all page cache, optimization cache and CDN cache should be cleared.

    If the original reporter has the same console error, it is very likely the same issue.

    Thread Starter maco272

    (@maco272)

    Hello,

    i think problems are more plugins, i tested it but more plugins when are active cause this problem, i don’t know where is problem.

    • This reply was modified 1 week, 5 days ago by maco272.
    Plugin Support Luiggi B.

    (@luiggiab)

    Hello everyone,

    The problem related to __maybeHideDefaultButtonOnInit has been fixed and the changes will be available with the next update of the plugin.

    For now, you could use the alpha version from the link below:

    1. Could you please test this alpha version and check if it fixes the issue you were experiencing?
    2. If the issue persists, please open a new ticket with detailed information on how to replicate it. It may be a different issue entirely, so having a separate ticket will help us investigate it properly.

    Kind regards,
    Luiggi

    • This reply was modified 1 week, 5 days ago by Luiggi B..
    • This reply was modified 1 week, 5 days ago by Luiggi B..
    Thread Starter maco272

    (@maco272)

    Hello, i confirm that 4.2.6. alpha version work well 🙂 thanks for help

    Plugin Support Luiggi B.

    (@luiggiab)

    Hello everyone,

    We have now released Fluid Checkout Lite 4.2.6, which includes the fixes that were previously available in the alpha version.

    The update has been published and is currently awaiting approval from WordPress.org, which may take a little time. In the meantime, you can install the official release directly using the package below:

    I’m closing this ticket for now. If you need further assistance related to this issue, simply reply to this message to re-open it.

    Kind regards,
    Luiggi

Viewing 8 replies - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.