To give full-price items 20% off and sale items 10% off with one code, add two product discounts to the same code: a 20% discount with the sale item rule Exclude sale items, and a 10% discount with no rule. Full-price items qualify for both and get the bigger one, 20%. Sale items only qualify for the 10%.
OneCode: Stackable Discounts decides what counts as a sale item when the customer checks out: any item whose compare-at price is higher than its price. It checks each item in the cart, so if only some sizes or colors of a product are reduced, the full-price ones still get 20%. You don’t need to keep a list of full-price products up to date.
A cart with a $50 full-price shirt and jeans reduced from $80 to $60:
- The shirt gets 20% off, $10, so it costs $40.
- The jeans get 10% off their $60 sale price, $6, so they cost $54.
- The subtotal is $94.

Set it up
- In OneCode, click Create discount, keep Discount code, and enter
SAVE20. - Click Add Discount Type and enter
20in Percentage. Keep Target as All Products, or choose Specific Collections and pick the collections you want. - On that discount, click Add sale item rule and choose Exclude sale items.
- Click Add Discount Type and enter
10in Percentage, with the same Target. Do not add a sale item rule. - Click Save discount.

Each item gets only one product discount from the code, the one that saves the most. That is why a full-price item gets 20% and not 30%.
The three sale item rules
Each product discount in the code can treat sale items in one of three ways:
- Discount the sale price (default): the discount comes off the item’s current price. This is what happens with no rule.
- Discount from the compare-at price: the item ends at the discount’s percentage off its original price, or keeps its sale price if that is already lower. With 20% off, an item reduced from $100 to $85 ends at $80, so the customer saves $5 at checkout. An item reduced from $100 to $70 stays at $70. Items with no compare-at price get the normal 20%. This rule is only for Percentage discounts.
- Exclude sale items: sale items get nothing from this discount, and they don’t count toward its Group Subtotal, Group Quantity or quantity limit. They still count toward Cart Subtotal and Cart Quantity, which measure the whole cart.

If you would rather not stack a code on top of a sale at all, use a single 20% discount with Discount from the compare-at price. Each item ends at 20% off its original price, unless its sale price is already lower.
Sale item rules are only on product discounts. An order discount comes off the whole order, sale items included. To leave subscription items out of a product discount, click Add exclusions and tick Exclude subscription items. See subscription discounts.
OneCode costs $9.90 USD every 30 days after a 7-day free trial, billed by Shopify. Install it from the Shopify App Store.