fix: products with attachments were being duplicated when increasing quantity in minicart #334
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What problem is this solving?
This PR aims to fix (add a new param) to the KI: #337069
If a store uses the product-list component of Store Framework, used in the minicart, cart items may be duplicated when increasing the quantity of an item that has an attachment (itemAttachment).
This is because the default noSplitItem behavior of the API request that updates cart items is false.
With this PR, now, it's possible to add a prop splitItem in minicart-product-list, so, the customer will choose if they want or not to split the products in minicart.
How to test it?
Expected: Just increase the quantity of the product (A.K.A increase the SKU of a single product)
What was happening: Splitting the product into different products with only 1 quantity
Screenshots or example usage:
Before
Screen.Recording.2024-07-01.at.3.45.23.PM.mov
After
Describe alternatives you've considered, if any.
We keep the same default behavior (split = true), even though several clients were complaining about that.
The positive side effect is that this is not going to affect any live store
The negative side effect is that the client will have to change their theme in order to fix/change this behavior
Related to / Depends on
vtex-apps/checkout-resources#102
vtex-apps/product-list#159
https://github.com/vtex/order-items/pull/38
How does this PR make you feel? 🔗
Split king