• Resolved blghna

    (@blghna)


    Hello,

    I am using your plugin and haven’t encountered any functional issues. However, when I click the “add to cart” button, it doesn’t transition from the loading stage to the added stage. Instead, a hypertext link saying “My Cart” appears next to it. I tried disabling the theme and testing it with Twenty Twenty-Four, but the issue persists.

    here issue image: https://imgur.com/a/uepJDPx

    my product page: https://www.tagrean.com/shop/kolye/signature-kolye

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    Thanks for reaching out!
    It appears that the issue you are encountering may be related to any script error. Hence We need to conduct a thorough investigation. Therefore, we kindly request that you reach out to us directly via our website, and submit a ticket regarding this matter.

    Thanks,
    Acowebs Support.

    Plugin Support Vivek Acowebs

    (@viveke)

    Hi,

    The issue seems to be related to the compatibility with your theme or custom scripts.

    To resolve this, please add the following custom JavaScript snippet to your site to remove the button loading state:

    jQuery(document.body).on(‘added_to_cart’, function(event, _a, _b, button){
    if(button){
    jQuery(button).removeClass(“btn-loading”);
    }
    });

    Thanks.

    Thread Starter blghna

    (@blghna)

    Thank you for getting back to me. I’ve solved the problem using a similar approach. Have a good day!

    I’m attaching the script below for those who might encounter a similar issue.

    <script>
    jQuery(document).ready(function($) {

    var targetNode = document.querySelector('.single_add_to_cart_button');

    var observer = new MutationObserver(function(mutationsList, observer) {
    for (var mutation of mutationsList) {
    if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
    if ($(mutation.target).hasClass('added')) {

    $('.single_add_to_cart_button').hide();


    $('.added_to_cart').addClass('btn').show();
    }
    }
    }
    });


    observer.observe(targetNode, { attributes: true });
    });
    </script>
    • This reply was modified 8 months ago by blghna.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘add-to-card ajax problem’ is closed to new replies.