pucilpet Posted September 1, 2015 Share Posted September 1, 2015 Hi,I need to add a javascript calls to shopping cart. Where should I add these pieces of code? Also how can I pull product id, price, name (and category if possible)?I appreciate your help! I need to run this javascript code when a product gets added to cart: window._cshq = window._cshq || []; // always confirm that the events queue exists, or create it window._cshq.push(["_addToCart", // add the product { "ProductId" : product.sku, "Quantity" : "1", "UnitPrice" : "24.50", "Name" : "product name" "Denomination" : "EUR" } ]); and this call when a product is removed from the cart: window._cshq = window._cshq || []; // always confirm that the events queue exists, or create it window._cshq.push(["_removeFromCart", // remove the product { "ProductId" : product.sku, "Quantity" : "1" } ]); Link to comment Share on other sites More sharing options...
NemoPS Posted September 2, 2015 Share Posted September 2, 2015 ajax-cart.js in your theme folder, modules, blockcart. I'd do it in the "add" method of the ajaxCart object. The other in the remove.Make sure you reference variables correctly 1 Link to comment Share on other sites More sharing options...
pucilpet Posted September 15, 2015 Author Share Posted September 15, 2015 If someone could help me with integrating this, please contact me with a quote. You can send me a private message. Thanks! 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