bhushan_k Posted April 17, 2017 Share Posted April 17, 2017 In prestashop 1.7, I have a module that displays content on the shopping cart page (hook displayShoppingCartFooter). I want to refresh what is displayed after the cart is updated (e.g. changed quantity, delete item). What hook can I use for the same or how can I trigger the refresh after the cart has been updated (the content displayed by my module depends on the cart contents, so this should happen after the cart is updated). afterCartSave hook does not help. Any guidance? Thanks! Link to comment Share on other sites More sharing options...
vekia Posted April 18, 2017 Share Posted April 18, 2017 you can use emitter 'on cart update', and then - do an ajax request to your module and update the contents http://developers.prestashop.com/themes/javascript/index.html updatedCart On the cart page, everytime something happens (change quantity, remove product and so on) the cart is reloaded by ajax call. After the cart is updated, this event is triggered. Link to comment Share on other sites More sharing options...
bhushan_k Posted April 18, 2017 Author Share Posted April 18, 2017 Thanks Vekia. Can you please point me to a example module where this is being done? Link to comment Share on other sites More sharing options...
Shradha.Mankar Posted July 18, 2019 Share Posted July 18, 2019 i am having the same issue Link to comment Share on other sites More sharing options...
mangeur de fleurs Posted December 5, 2023 Share Posted December 5, 2023 On 7/18/2019 at 8:49 AM, Shradha.Mankar said: i am having the same issue Hello, have you find a solution to your problem ? Link to comment Share on other sites More sharing options...
Pete78 Posted September 3 Share Posted September 3 On 12/5/2023 at 3:03 PM, mangeur de fleurs said: Hello, have you find a solution to your problem ? $(document).ready(function () { if (typeof prestashop !== 'undefined') { prestashop.on( 'updateCart', function (event) { if (event && event.resp ) { // here you do some modifications as you want. Like doing ajax calls, add classes to divs, hide elements... //you can examine the event for available values (event.resp.cart ie.) } } ); } }); You have to add this code within your own module or extend the module you want to behave different... 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