Shopify / ui-extensions

MIT License
249 stars 35 forks source link

POS UI extensions - bulkAddLineItemProperties affects quantity #1990

Open galmis opened 1 month ago

galmis commented 1 month ago

Please list the package(s) involved in the issue, and include the version you are using

@shopify/retail-ui-extensions-react v1.7.0

Describe the bug

Adding line item properties to different line items of the same product variant changes quantity

Steps to reproduce the behavior:

  1. In admin create a buy 2 get 1 discount code - ensure the "Customer buys" and "Customer gets" are set to the same product.
  2. In POS add 3 instances of the same product and apply the discount code. There should be 2 lines of the same product variant.
  3. Add line item properties via bulkAddLineItemProperties - notice how the 2nd line is deleted.

Note that applying the same discount on 4 instances of the same product variant and bulkAddLineItemProperties updates the 1st line's quantity from 1 to 2.

Expected behavior

I'd expect the line item properties to change without affecting the quantity of items.

Screenshots

Additional context

Luckily, it looks like addLineItemProperties doesn't have this problem. Similar issue - https://github.com/Shopify/ui-extensions/issues/1989.