pwa-studio icon indicating copy to clipboard operation
pwa-studio copied to clipboard

[bug]: Cart Becomes Empty When Updating Configurable Products

Open Masumisigma opened this issue 10 months ago • 1 comments

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

Masumisigma avatar Feb 05 '25 19:02 Masumisigma

Hi @Masumisigma. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information. Add a comment to assign the issue: @magento I am working on this


Join Magento Community Engineering Slack and ask your questions in #github channel.

m2-assistant[bot] avatar Feb 05 '25 19:02 m2-assistant[bot]

@adobe export issue to JIRA project PWA as Bug

glo82145 avatar Jul 17 '25 07:07 glo82145

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/PWA-3537 is successfully created for this GitHub issue.

github-jira-sync-bot avatar Jul 17 '25 07:07 github-jira-sync-bot