Back to Theme support

Add to cart duplication issue

We have seen issues suddenly beginning to occur where Add to cart is duplicating for some products. This is down to a change that Shopify announced on October 21st 2025 without warning where internal changes to the handling of the Ajax cart API which our themes use were made.

The following code change is a simple 2 line copy and paste which will fix the issue.
This will be included in all future theme releases from October 22nd 2025.

 

  1. In your, Shopify admin click on Online store > Themes > click the menu icon with three black dots and select duplicate theme. This makes a backup of your theme so that you can revert back to this if anything goes wrong.

  2. Now on your published theme click on that same menu icon with the 3 black dots and  choose Edit Code

  3. On the left side of the screen click on the search box and search for:
    document.querySelectorAll(selectors.addToCart).forEach((element, i) => {      
    
  4. Directly beneath this make a few lines of space and paste in the following:
    if (element.dataset.ajaxBound === '1') return;
    element.dataset.ajaxBound = '1';      
    

    So that it looks like this...

    document.querySelectorAll(selectors.addToCart).forEach((element, i) => {
      
      if (element.dataset.ajaxBound === '1') return;
      element.dataset.ajaxBound = '1';
      
      element.addEventListener('click', function (e) {
        e.preventDefault();
        ...
    
  5. Click Save when done - this will fix the issue.