You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
What this code does, in a nutshell: Whenever you change the quantity of an item called "Hoodie", it searches for an item called "Belt", and tries to keep the quantity of the latter in sync with the former. Here's how this works in the legacy cart:
Screen.Recording.2021-11-23.at.05.15.18.p.m.mp4
And here's what's happening in the block cart:
Screen.Recording.2021-11-23.at.05.17.51.p.m.mp4
Note that I need to refresh to get the qty of the "synced" item to update, although it's coming back just fine through the API.
This is a roadblock that we'll need to overcome to make the new Cart/Checkout Blocks compatible with Force Sells, Product Bundles, Composite Products, Mix and Match Products, and likely other extensions that rely on the woocommerce_after_cart_item_quantity_update filter to keep cart item quantities in sync.
Expected behavior
Cart item quantities should always render the values passed down via the API.
Screenshots
See above.
Environment
WordPress (please complete the following information):
Describe the bug
One issue I attempted to tackle here, is this:
When custom code is used to keep the quantities of two (or more) items in sync, the quantities of "dependent" items fail to render correctly.
To reproduce
Here's some code you can use to play around with this state-related problem:
What this code does, in a nutshell: Whenever you change the quantity of an item called "Hoodie", it searches for an item called "Belt", and tries to keep the quantity of the latter in sync with the former. Here's how this works in the legacy cart:
Screen.Recording.2021-11-23.at.05.15.18.p.m.mp4
And here's what's happening in the block cart:
Screen.Recording.2021-11-23.at.05.17.51.p.m.mp4
Note that I need to refresh to get the qty of the "synced" item to update, although it's coming back just fine through the API.
This is a roadblock that we'll need to overcome to make the new Cart/Checkout Blocks compatible with Force Sells, Product Bundles, Composite Products, Mix and Match Products, and likely other extensions that rely on the
woocommerce_after_cart_item_quantity_update
filter to keep cart item quantities in sync.Expected behavior
Cart item quantities should always render the values passed down via the API.
Screenshots
See above.
Environment
WordPress (please complete the following information):
The text was updated successfully, but these errors were encountered: