Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
1) User adds item to cart, Ajax refreshes the cart pane
2) User clicks back button to return to a previously viewed page
bug: the items added to cart in 1) are not shown
Comments
Comment #1
tunicBug confirmed. I'm working on it.
Comment #2
tunicI guess that when page is loaded browser uses a cached copy, so cart info is outdated. It has been fixed adding an option to force reload of cart contents with registered users on page load. This solution may put a little bit load on server (because server must calculate cart content on every page served and when ajax call is made).
I don't know if there's a way to detect, in JS layer, if page is loaded from server of loaded from browser cache. if there's a way to know this JS layer could make the ajax call only when a cached copy is used.
Commited fix to dev.
Comment #3
sirleech CreditAttribution: sirleech commentedTested latest dev, this fix works. Nice job.