This is a good example https://help.shopify.com/en/manual/checkout-settings/script-editor/examples/line-item-scripts#tiered-product-discount-by-quantity
But I need it to work only if you enter code herechoose the same variant. You cant mix and match. The product has multiple variants but I only want the discount to apply if the product is in the same variant group.
discount +10 same products
- Example 1 correct
- Phone / variant Black x10 = discount
- phone / variant Red x5 = NO discount
- Example 2 incorrect
- Phone / variant Black x5 = discount
- phone / variant Red x5 = discount
Discount applied because total is 10 but its incorrect because the variant is not the same
Thanks for the help.