Shopify Dawn Theme Hide/Disable Add to Cart Popup

  1. Open theme code
  2. Find a file called cart-notification.js under the Assets category. Shopify Dawn Theme Hide/Disable Add to Cart Popup
  3. Find following lines of code
    
    renderContents(parsedState) {
          this.cartItemKey = parsedState.key;
          this.getSectionsToRender().forEach((section => {
            document.getElementById(section.id).innerHTML =
              this.getSectionInnerHTML(parsedState.sections[section.id], section.selector);
          }));
          if (this.header) this.header.reveal();
          this.open();
      }
    
    
  4. Comment out the last line which triggers the opening of popup.
  5. It should look like this
    
    renderContents(parsedState) {
          this.cartItemKey = parsedState.key;
          this.getSectionsToRender().forEach((section => {
            document.getElementById(section.id).innerHTML =
              this.getSectionInnerHTML(parsedState.sections[section.id], section.selector);
          }));
        /*
          if (this.header) this.header.reveal();
          this.open();
       */
      }
    
    
  6. Save the code
  7. Refresh the product page.
  8. Try adding a product to cart, the popup will not open.