Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Product Discounts - Duplicate Line Items In Checkout

Product Discounts - Duplicate Line Items In Checkout

VitaDev
Shopify Partner
12 0 4

I recently ran into a problem while developing a product discounts function. The function should apply discounts to a certain quantity of a product variant, which may result in a line item split. In the cart this works fine, but in the checkout I get unnessecary additional line items displayed. Expected are two lines - one with a discount and one without a discount, but in checkout there is a third line - also not discounted. The total quantity is still correct, but an additional line split happens. As far as I could see, this happens if and only if the non-discounted line appears before the discounted line in cart.

The function run result only allows targeting a product variant and not specific lines, so I do not see room for changes in the function here. That is why it seems like a bug to me. I appreciate any help on this.

Replies 5 (5)

SBD_
Shopify Staff
1831 273 421

Hey @VitaDev 

 

Are you able to DM me replication steps please?

Scott | Developer Advocate @ Shopify 

VitaDev
Shopify Partner
12 0 4

Sure, I sent you more info.

shaquibimdad
Shopify Partner
2 0 2

i am facing the same issue please update on this

aclough
Shopify Partner
3 0 2

Hi, 

 

We are experiencing the same issue with a native buy x get y discount in Shopify. If the customer moves to and from the cart the discounted product is duplicated. 

 

Was there any resolution? Thanks. 

Deniz_KK
Shopify Partner
3 0 1

@SBD_ Were facing the same issue. Are there any news about the progress solving this problem?