POS Line item properties are ignored when there's already a line item for the same variant id in the cart
With our current embedded app, we add specific line item properties to line items and then add them to the cart using cart.dispatch(Cart.Action.ADD_LINE_ITEM, payload);. If our app goes to add a second line item to the cart for the same variant but with different properties, the quantity on the original line item is incremented and the properties are ignored.
To Reproduce
Steps to reproduce the behaviour:
Step 1: Add a line item to your cart using the POS SDK
I would expect that the cart would then contain two separate line items with the following attributes, one for each of the calls above and with different line item properties. This is how the storefront behaves and allows us to vary line item properties for the same variant id
What actually happens is that the cart ends up with a single line item with the quantity totaling the sum of both line item calls (x5) and the second line item property is ignored.
Contextual information
It's essentially the same error as in #28 but I thought it would be fixed considering the ADD_LINE_ITEM call now supports passing in properties instead of having to make a subsequent call to SET_LINE_ITEM_PROPERTIES.
Packages and versions
List the relevant packages you’re using, and their versions. For example:
Describe the bug
POS Line item properties are ignored when there's already a line item for the same variant id in the cart
With our current embedded app, we add specific line item properties to line items and then add them to the cart using
cart.dispatch(Cart.Action.ADD_LINE_ITEM, payload);
. If our app goes to add a second line item to the cart for the same variant but with different properties, the quantity on the original line item is incremented and the properties are ignored.To Reproduce
Steps to reproduce the behaviour:
Step 1: Add a line item to your cart using the POS SDK
Step 2: Add another line item with different properties and the same variant id
Expected behaviour
I would expect that the cart would then contain two separate line items with the following attributes, one for each of the calls above and with different line item properties. This is how the storefront behaves and allows us to vary line item properties for the same variant id
What actually happens is that the cart ends up with a single line item with the quantity totaling the sum of both line item calls (x5) and the second line item property is ignored.
Contextual information
It's essentially the same error as in #28 but I thought it would be fixed considering the ADD_LINE_ITEM call now supports passing in properties instead of having to make a subsequent call to
SET_LINE_ITEM_PROPERTIES
.Packages and versions
List the relevant packages you’re using, and their versions. For example:
@shopify/app-bridge
@^3.4.3
@shopify/app-bridge-react
@^3.4.3
@shopify/polaris
@^10.10.1
Platform