Jump to content

[SOLVED] Add to cart button is not working in CMS page


Recommended Posts

Hello Every one,

 


1. <a id="ajaxButton_8" class="exclusive ajax_add_to_cart_button" title="Add to cart" href="../cart.php?qty=1&id_product=8&token=$token=Tools::getToken(true)&add" rel="ajax_id_product_8">Add to cart</a>
 
2. <a onclick="ajaxCart.add(product_id=2, attribute_id=null, true, null, quantity=1, null);">Add to cart</a>
 
 

The above both "Add to cart" buttons are not working in CMS page. 1st one is redirecting to "<domain>/cart.php?qty=1&id_product=8&token=$token=Tools::getToken(true)&add " and product is not getting added to cart. 2nd link is not working...

 

Could anybody help......

Link to comment
Share on other sites

what errors you usee in browser console?

can you share url to page where you use this code?

 

<a onclick="ajaxCart.add(product_id=10, attribute_id=0, true, null, quantity=1, null);">Add to cart</a>

 

When i click on the above link,  I'm getting the below error.

 

"ajaxCart is not defined

Link to comment
Share on other sites

×
×
  • Create New...