Drupal 7 no longer allows page caching for anonymous users that have data in the session. This means we don't need to launch with AJAX based cart contents loading to achieve a dynamic cart block for anonymous users. However, should we either want to customize caching or customize the way shopping carts are associated to anonymous users (i.e. not with a session variable), we may need to implement some method to load the cart block contents via AJAX.
Comments
Comment #1
rszrama commentedLet's call this a contrib problem for now that we can possibly roll into core later if necessary. However, this may be complicated by the fact that we're totally depending on Views to create and display the cart block.
Comment #2
catchJust ran into a need for this:
For example the following interaction can be a bit confusing:
1. Click to a product
2. Add item to cart
3. Use back button to get back
You expect to see the item in your cart (either the block or the menu link count), but it looks like it's been 'lost'.
With 8.x both the cart block and the menu link could assign cache contexts so that they get auto-placeholdered and cached correctly, but that wouldn't help with the back button issue.