WarrenS Posted October 7, 2012 Share Posted October 7, 2012 I am sure this is a simple fix. After a product is added to the cart I would like the product page to refresh so that the reduced pricing is then updated and shown accordingly. Can anyone tell me what is the code and where to put it? Thankyou, Warren. Link to comment Share on other sites More sharing options...
shacker Posted October 9, 2012 Share Posted October 9, 2012 edit the blockcart/ajax-cart.js and add this line location.reload(); after the add to cart action Link to comment Share on other sites More sharing options...
TheRedFeathers Posted October 10, 2012 Share Posted October 10, 2012 edit the blockcart/ajax-cart.js and add this line location.reload(); after the add to cart action Please could you expand? Do I add it in here somewhere? //for every 'add' buttons... $('.ajax_add_to_cart_button').unbind('click').click(function(){ var idProduct = $(this).attr('rel').replace('ajax_id_product_', ''); if ($(this).attr('disabled') != 'disabled') ajaxCart.add(idProduct, null, false, this); return false; }); Link to comment Share on other sites More sharing options...
shacker Posted October 17, 2012 Share Posted October 17, 2012 $('.ajax_add_to_cart_button').unbind('click').click(function(){ var idProduct = $(this).attr('rel').replace('ajax_id_product_', ''); if ($(this).attr('disabled') != 'disabled') ajaxCart.add(idProduct, null, false, this); location.reload(); return false; }); Link to comment Share on other sites More sharing options...
TheRedFeathers Posted October 17, 2012 Share Posted October 17, 2012 Thanks, but unfortunately that doesn't work for me. Link to comment Share on other sites More sharing options...
vekia Posted October 17, 2012 Share Posted October 17, 2012 Thanks, but unfortunately that doesn't work for me. do you have ajax cart turned to on in back office/ Link to comment Share on other sites More sharing options...
WarrenS Posted October 17, 2012 Author Share Posted October 17, 2012 Tried it too - didnt work for me either - yep got Ajax turned on. Im trying to get the page to refresh after the cart is added to so that it then displays the new reduced pricing so my customer knows that the price has been reduced since adding to the cart. Link to comment Share on other sites More sharing options...
TheRedFeathers Posted October 17, 2012 Share Posted October 17, 2012 Yeah, Ajax is on Link to comment Share on other sites More sharing options...
nikpony Posted March 20, 2016 Share Posted March 20, 2016 Sorry for retrieving a too old post but for everyone who's looking for a solution, have to add the location.reload(); after the window.parent.ajaxCart.updateCartInformation(jsonData, addedFromProductPage); or something else depending your Prestashop version! Link to comment Share on other sites More sharing options...
PrabuSS Posted May 20, 2017 Share Posted May 20, 2017 Hi Unfortunately your code is not working in PS 1.6.1.11. Please any one. Link to comment Share on other sites More sharing options...
Recommended Posts