• Resolved figtreedigital

    (@figtreedigital)


    Hi there,

    We having an issue with the add to cart button on mobile devices eg iPhones when you have slow website speed.

    When you click on the add to cart button sometimes no items are added to the cart. This seems to happen when you click on multiple add to cart buttons.

    Any idea how we can debug this?

    The page I need help with: [log in to see the link]

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

    (@troy401)

    Hey,

    I’m also running into the same issue on mobile.

    I’ve had a look at the page you linked, it seems you’ve found a solution to the problem.

    If you could share how you fixed the issue that would be greatly appreciated.

    Plugin Author The Rite Sites

    (@theritesites)

    Hello!
    Sorry for the late response, just getting to do some testing on this.

    I guess it all kind of comes down to what errors you were getting.
    I was able to recreate an error one time and the console told me I was getting a 403, permission denied. I got this right after a page load and kept getting it with a continued greyed out button until I refreshed the page, then I couldn’t recreate the error again. I tried it on a couple browsers using throttling and 2 different phones. I only achieved recreation in firefox throttling to 2G

    There is a nonce check, and my guess with a 403 is that is where the plugin is failing.

    If you have caught this error, do you have any more information on how to recreate the issue?

    If we find the nonce is what is causing the problem, then we can even remove the nonce and see if the problem is fixed. We should not need a nonce in this instance anyways as it does not matter if the user is logged in or out to add items to their cart for the most part.

    Thread Starter figtreedigital

    (@figtreedigital)

    Hey Guys,

    The error was to do with AJAX on mobile.

    The AJAX within the plugin was causing issues on mobile.

    I didn’t have the time to fix the issue within the plugin. So I installed another plugin overtop what fixed the AJAX error.

    Plugin was: https://wordpress.org/plugins/woo-floating-cart-lite/

    troy401

    (@troy401)

    Sorry I’m not too code savvy. I’m an in house graphic designer.

    I’ve been testing two add to cart buttons on a single page (different products).

    On mobile it would work on the first click, then if you clicked either add to cart button, it wouldn’t load.

    I’ve logged into wp-admin on my mobile and have viewed the page, and I can press any of buttons and they will add to cart numerous times and work perfectly.

    So for me it seems to only work properly for logged in users. Tested customer and administrator logins and both work. So its only users who are logged out who cannot add to cart multiple times.

    HTTP403: FORBIDDEN – The server understood the request, but is refusing to fulfill it.
    (XHR)POST – https://www.cockburnicearena.com.au/wp-admin/admin-ajax.php

    failure! enhanced-ajax-add-to-cart-wc.min.js

    The page im working on: https://www.cockburnicearena.com.au/birthday-booking-form/

    Plugin Author The Rite Sites

    (@theritesites)

    Can I send you a new version of the plugin privately? I would like to try the fix I have but I cannot recreate the issue even with the above instructions. I think I got it though.
    Email me at parker@theritesites.com
    I will send you a zip for you to try and if all goes well I will push it out as a new version!

    Plugin Author The Rite Sites

    (@theritesites)

    I removed the nonce check as it seemed to be causing the issue with non-logged in users, especially on slower networks. Thanks for all of your patience!

    Cheers,
    Parker Mathewson

    Hello,

    Is there a way to hide the quantity buttons and just have the quantity field where they can enter the quantity?

    Thanks

    Ryan

    Plugin Author The Rite Sites

    (@theritesites)

    We have no plans to make that a feature of this plugin, but here is some custom CSS that you can put into your styles.css in your theme or wherever you see fit:

    .woocommerce-variation-add-to-cart .qty::-webkit-outer-spin-button, .woocommerce-variation-add-to-cart .qty::-webkit-inner-spin-button {
    	-webkit-appearance: none;
        margin: 0;
    }
    
    .woocommerce-variation-add-to-cart .qty {
    	-moz-appearance: textfield;
    }

    If you would like more information on how to do more with javascript while interacting with the number input, there is a good short article found here
    Short tutorial for removing number input arrows/scroll

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

The topic ‘add to cart issue’ is closed to new replies.