Shopify / function-examples

MIT License
186 stars 53 forks source link

Conditions on discount codes are ignored on expand (and even merge) operations #507

Open patrick-schneider-latori opened 5 months ago

patrick-schneider-latori commented 5 months ago

By using discount codes and excluding specific products but using those products in an expand operation, the condition of the discount code gets fully ignored, and therefore added as discounted line item component to a cart.

See in this screenshot, we have an expanded product which has a deposit as separate product applied and for comparison reasons also as a single standalone deposit product.

You can see that if a 10% discount is active, which is ONLY allowed to be valid for the "Kellerbier", the discount also gets applied to the line item component. To see, that the condition really kicks in, you can compare it with the single deposit product, which is also in the cart:

Bildschirmfoto 2024-05-28 um 16 34 00

I assume, that the discount code gets first applied to the original product BEFORE the expaned operation is applied to, and therefore also the discount code applications are applied to the expanded line item components.

I think, that this is a bug in Shopfiy Functions and therefore it should be investigated and fixed.