danvers Posted May 12, 2014 Share Posted May 12, 2014 I've got a custom page, where I would like to add a link to automatically add to cart just 1 quantity of a product in my catalogue. I've search the web, I've found this piece of code: <script type="text/javascript"> ajaxCart.add(ID_PRODUCT , ID_ATTRIBUTE , AJOUTAPARTIRDELAFICHEPRODUIT , ELEMENT , QUANTITY , WISHLIST); ajaxCart.refresh(); </script> but, the thing is I don't know how to place it, and how to change the attribute. So, can someone post an example of how it can be done? I'm on PS 1.6 Thank you. Link to comment Share on other sites More sharing options...
vekia Posted May 13, 2014 Share Posted May 13, 2014 and how to change the attribute. create function function myaddtocart(product_id,attribute){ ajaxCart.add(product_id , id_attribute , AJOUTAPARTIRDELAFICHEPRODUIT , ELEMENT , QUANTITY , WISHLIST); ajaxCart.refresh(); } then call this function in that way: myaddtocart(5,15); Link to comment Share on other sites More sharing options...
danvers Posted May 13, 2014 Author Share Posted May 13, 2014 (edited) Thank you. But it's just not working. I can't create a function or savec a script in my cms page using the CMS page editor. How can I just add a product to my cart in a CMS page?? Edited May 17, 2014 by danvers (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now