ilclaudio Posted August 26, 2016 Share Posted August 26, 2016 Hi all, I've an e-commerce with a single page checkout. I've done some modifications to this page: order-opc.tpl so that some text messages appears based on the presence or the absence of some products. The problem is that these messages appear only when the page is reloaded. When I remove a product from the cart the page is not reloaded and the messages are not refreshed. How can I solve this problem according to you? Thank you very much claudio Link to comment Share on other sites More sharing options...
Knowband Plugins Posted August 26, 2016 Share Posted August 26, 2016 You can try adding the following script though header hook or add this code directly to you header.tpl $(document).ajaxComplete(function(event, xhr, settings) { if (typeof (settings.data) != "undefined") { var data = settings.data.split('&'); if (data[0] == 'controller=cart' && data[1] == 'ajax=true' && (data[2] == 'delete=true' || data[2] == 'add=true')) { location.reload(); } } }); 1 Link to comment Share on other sites More sharing options...
ilclaudio Posted August 26, 2016 Author Share Posted August 26, 2016 Hi KnowBand, thank you for your answer. In the meantime I've resolved modifying the function processDeleteProductInCart in the CartController.php by adding at the end the line: $this->ajax_refresh = true; to force the reload of the page. Now I'll see your code because I've the same problem removing stuff from the ajax cart in the header of the site. cld 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