Shopify Function · Cart and checkout validation
Limit gift items to two per order for retail customers
Limit items tagged “gift” to two units. Buyers tagged “member” or “wholesale” are exempt.
How the rule works
-
- When
- A buyer with neither the “member” nor “wholesale” tag adds more than two units tagged “gift”.
- Then
- Block checkout until the number of gift items is within the limit.
What shoppers see
- 3 gifts
- Checkout pauses with the message “Retail orders can include up to two gift items.”
- 2 gifts
- The shopper can continue through checkout.
Set it up in your shop
Choose the condition that blocks checkout and write the message buyers will see. Test a blocked cart, then make the change the message asks for.
Open the rule as a draft in Mechanic. Test it with your products before publishing.
Customize this Function in Mechanic