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

  1. Within the design canvas, click on the Commerce Ai layer and click ‘Edit Plugin Code’
  2. Search for the Integration function area. I would recommend searching for ’addtocartshopify’ and going to the second result. (Screenshots below)
  3. 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();

    shopify commerce ai refresh

 

BigCommerce, Wordpress, and Magento

  1. Within the design canvas, click on the Commerce Ai layer and click ‘Edit Plugin Code’
  2. Search for the Integration function area. I would recommend searching for ’addtocart(ecommercehost)’ and going to the second result. (Screenshots below)
  3. Replace the highlighted code with: 
    top.location.reload();

    BigCommerce:


    WordPress:


    Magento:
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us