magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Cart caching problems

Open ivanweiler opened this issue 8 years ago • 48 comments

Description (*)

Hello,

If customer adds product to cart, content of its cart is cached in browsers local storage. Now, if price of any product in cart change for any reason (catalog rule, special price, main price change) while customer is on site:

  1. wrong price is displayed in mini cart on all pages
  2. wrong price is displayed in main Cart page, but right Summary box is reloaded with correct price; so there are 2 totally different prices displayed on Cart page for the same product (this one on current develop branch, not sure for stables)
  3. wrong price is even displayed on first Checkout step in Order Summary box

Any customer would be really confused with this, he/she would either quit or not notice change and buy at the wrong price.

This is just one example, I believe many more edge cases can be presented, maybe going out of stock or something like that.

I'm not sure if current customer data js cache has any mechanism to be invalidated by the server. Magento cache was flushed btw, has nothing to do with this.

It's also for discussion how secure is caching customer name and similar data to local storage, but that's another topic :)

Regards, Ivan

Preconditions (*)

Magento 2.4-develop

Steps to reproduce (*)

  1. From Magento Admin go to Catalog - Products, Add a Simple Product
  2. Fill in all the required fields, set Price 100 for example, Save the Product
  3. Open Store View, and Add the previously created Product to Cart
  4. From Magento Admin go to Catalog - Products, and Edit the previously created product, set Price to 90, for example. Save
  5. Open Store View, refresh the web page
  6. Click on Cart in the top right corner and verify the Price

Expected result (*)

The price should be updated to 90

Actual result (*)

The price in Cart remains 100 but the price of the Product in Category is updated to 90 price

Additional Notes (*)

The price is Updated in View and Edit Cart, and in Summary

ivanweiler avatar Mar 02 '16 23:03 ivanweiler