workarea-commerce/workarea

Disable Cart Popup Buttons When Quantity is Changing

Closed this issue · 0 comments

tubbo commented

Describe the bug
Changing quantity and immediately clicking "View Cart" or "Checkout" on the popup when you add an item to cart can cause the quantity change request to be cancelled before the next page is loaded. This causes some confusion on the user's part (I know it did for me) and might result in someone accidentally ordering the wrong quantity. To help prevent this, add data-disable-with to the buttons below the cart popup summary, ensuring they're disabled until the ajax request(s) complete.

To Reproduce
Steps to reproduce the behavior:

  1. Add a product to cart
  2. Change quantity in the form
  3. Before it submits, click "Checkout"
  4. Quantity will be different than the last value

Expected behavior
"Checkout" should not be clickable until the quantity update request finishes.

Workarea Setup (please complete the following information):

  • Workarea Version: v3.5.0