Shopify Dawn Theme Hide/Disable Add to Cart Popup
- Open theme code
-
Find a file called
cart-notification.js
under theAssets
category. - 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(); }
- Comment out the last line which triggers the opening of popup.
- 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(); */ }
- Save the code
- Refresh the product page.
- Try adding a product to cart, the popup will not open.