-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
Issue
We have been getting reports from users saying that they added product to cart, tried to checkout, but when they go to the cart, the cart was empty, but the mini-cart still showed products.
We have been getting customer complaints about this issue in every release of Magento 2 we have used since October, up to and including our current implementation which is 2.1.11.
This has obviously been a nightmare to debug, but we have figured out how to reproduce it 100%, in Luma.
Preconditions
Dedicated server,
Magento 2.1.11.
CentOS 7.3.
PHP 7.
MariaDB.
Double Redis (session and cache).
Images on a CDN.
Steps to reproduce
- Add product to cart
- Click on cart
- Click on checkout button multiple times before the checkout page has loaded. At least two clicks are necessary.
- You will now be on a cart page page that says your cart is empty but your minicart will still have content.
Actual result
The user will be directed to a cart page saying there are no items in the cart, but the mini-cart will still have contents.
Expected result
The cart should have items in it.
Misc
I believe that this is probably related to the "Hit refresh multiple times fast in checkout and your cart will be empty" bug edit which can be referenced here - #12362
Fix
We added some client-side code to disable the "checkout" button after it was clicked, which solves this issue. This obviously does not resolve the fundamental problem (double refresh on checkout page clears cart) but it should be done anyway if for no other reason than to reduce server load. We can create a pull request for this if needed.