Skip to content

Instant Cart FAQ

How to add AJAX “Add to Cart” button on CMS/Static page

Magento allows adding products with ‘Add to Cart’ buttons on static pages (for example, Home page). By default, ‘Add to Cart’ button will redirect your customers to cart page, when they add products from such pages. You can add add AJAX-based ‘Add to Cart’ button on CMS pages now. The solution is quite simple. You should add the following code for ‘Add to Cart’ button:

html <a rel="nofollow" href="#" onclick="setLocation('')">