Internal | Causing Commerce Ai to refresh the page after ‘add to cart click’
Causing a page refresh with the 'Add to Cart' click on Commerce Ai is a common solution when clients have a third party solution Ajax Cart which we cannot update the quantity count and ajax cart cart content.
Shopify
- Within the design canvas, click on the Commerce Ai layer and click ‘Edit Plugin Code’
- Search for the Integration function area. I would recommend searching for ’addtocartshopify’ and going to the second result. (Screenshots below)
- Locate the line that reads parent.jju('[data-section-id="header"]').html(htmlHeader);. Add a new line below and add the following:
top.location.reload();
BigCommerce, Wordpress, and Magento
- Within the design canvas, click on the Commerce Ai layer and click ‘Edit Plugin Code’
- Search for the Integration function area. I would recommend searching for ’addtocart(ecommercehost)’ and going to the second result. (Screenshots below)
- Replace the highlighted code with:
top.location.reload();
BigCommerce:
WordPress:
Magento: