Description
Describe the bug
When updating a configurable product in the cart under certain conditions, the cart becomes empty instead of retaining the selected item.
Issue 1: Selecting the same configurable product option
When a user tries to update a configurable product in the cart and selects the same options as before, the item is removed from the cart but not re-added, leaving the cart empty.
Issue 2: Selecting an out-of-stock configurable option
If a user updates a configurable product by selecting a variant that is out of stock, the item is removed from the cart, and the new selection is not added. This results in an empty cart instead of keeping the original item.
To reproduce
Scenario 1: Selecting the Same Configurable Option
Add a configurable product (e.g., a T-shirt with size M, color Red) to the cart.
Go to the cart page and attempt to update the product by selecting the same size and color.
Observe that the item gets removed from the cart and is not re-added.
Scenario 2: Selecting an Out-of-Stock Option
Add a configurable product (e.g., a T-shirt with size M, color Red) to the cart.
Go to the cart page and try updating the product by selecting a different variant that is out of stock (e.g., size L, color Blue).
The original item gets removed from the cart, and the new item is not added.
The cart becomes empty.
Expected behavior
If the user selects the same configurable option, the cart should remain unchanged.
If the user selects an out-of-stock option, the system should prevent the update and retain the original item in the cart.
The cart should never become empty due to a failed update.
Screenshots
https://github.com/user-attachments/assets/82f1c78c-3d6e-40e1-9629-87597500b9ac
https://github.com/user-attachments/assets/f54a3259-8a25-4730-a1dc-e58bb610e477
Possible solutions
Add any ideas about possible solutions to the problem here.
Debug Report
Paste the output of yarn build:report
, and any other context about the problem, here.
Please complete the following device information:
- Browser: Chrome, Safari
- Browser Version: 132.0.1
- Magento Version: 2.4.4
Please let us know what packages this bug is in regards to:
-
venia-concept
-
venia-ui
-
pwa-buildpack