Excluding Order Protection from Discounts
Learn how to exclude specific products from discounts and promotions in Shopify
This guide covers how to exclude products from discounts and promotions in Shopify, including both Shopify Plus and standard Shopify stores. We also cover removing OP from discounts and promotions in Big Commerce.
Shopify
Shopify Plus
Excluding a product from all discounts and promotions in Shopify typically involves using Shopify Scripts (for Shopify Plus merchants). Shopify Scripts allow you to customize discounts during the checkout process. Here’s how you can do it:
Identify The Product
Use the product ID, product handle, or product tag to identify the product(s) you want to exclude.
Tag the Product
In your Shopify admin, add the tag no_discount
(or a tag of your choice) to the product(s) you want to exclude.
Write the Script
Shopify Scripts are written in Ruby. Below is an example script that excludes specific products from discounts.
What the script is doing:
- Checks each line item in the cart
- If the product has the tag
no_discount
, the script resets its line price to the original price, removing any applied discount.
Save the Script
- Go to
Shopify Admin > Settings > Checkout > Scripts.
- Add a new script, paste the Ruby code, and save it.
Test the Script
Add the product to the cart and ensure that discounts are not applied to it.
Alternative Approaches
Exclude by Product ID or Handle
Exclude Multiple Products by Tag
These scripts ensure that excluded products retain their original prices, unaffected by automatic discounts or promotions.
Notes
- Shopify Plus Required: Shopify Scripts are only available to Shopify Plus merchants.
- Checkout Apps: If you are not on Shopify Plus, you may need to use a third-party app to achieve similar functionality.
Non-Shopify Plus (Smaller Plans)
Using Discount Conditions and Exclusions
While Shopify Plus offers more flexibility with scripts, standard Shopify (non-Plus) users can still manage some basic exclusions via the discount settings.
Steps for Producing Exclusions
- In your Shopify Admin, go to Discounts.
- Create or edit a discount code or automatic discount.
- Under Discount applies to, select Specific products.
- To exclude a product, don’t add it to the discount’s list of applicable products.
- You can also create a discount that applies to the entire order or specific product collections while making sure that the excluded product isn’t in those collections.
Limitations
This method is more restrictive. If you have multiple promotions running simultaneously, it may become cumbersome to manually ensure the correct exclusions. For more dynamic or complex scenarios, this might not be sufficient.
Tagging Products for Exclusions
A workaround to control product eligibility for discounts in a more granular way is to use tags.
Steps to Use Tags
- Add a unique tag to the products you wish to exclude, such as no-discount.
- Create a discount code or automatic discount with conditions that apply to products with specific tags.
- Exclude the tagged products from the discount by not including the tag when you set up the discount.
For example, in the discount setup: Apply to products without the no-discount tag.
Pro Tip: This requires manual intervention to tag products that should be excluded from discounts and could become cumbersome if you need to manage this frequently.
Third Party Apps
For more complex scenarios where you need full control over discount exclusions, there are several apps in the Shopify App Store that offer more advanced discount management features. Some of these apps allow you to exclude specific products or product collections from discounts, even if the discount would typically apply to the cart or order.
Some popular discount management apps include:
-
Automatic Discount & Gift: Provides advanced discount rules, including exclusions based on products, collections, tags, or other conditions.
-
Discounted Pricing by Booster Apps: Allows more complex discount rules, including exclusions of specific products.
-
Wholesale Pricing: If you have a wholesale channel, it helps exclude certain products from customer-specific pricing or promotions.
These apps often integrate directly with Shopify’s discounting system and allow more flexibility than Shopify’s native tools.
Using Shopify Scripts (via Third Party Integrations)
For stores using the Shopify Plus equivalent through third-party integrations, some apps may offer the ability to run scripts similar to Shopify Plus’s Script Editor, though this typically requires an additional subscription or a custom implementation. Apps (like Shopify Scripts by Bold Commerce or Shopify Plus-like Discount Logic apps) offer a way to write custom scripts for complex discount rules. However, this will require integration with apps that allow deeper customization.
Custom Development (Liquid Template Customizations)
If you’re comfortable with coding or working with a Shopify developer, you could implement a custom solution to remove discounts at checkout using Liquid (Shopify’s templating language) and some basic JavaScript.
Example Steps:
- Use Liquid to check the cart contents and identify if a product is in the “no discount” category or has a special tag.
- On the cart page or checkout page, use JavaScript to adjust the price or display a message that the product is not eligible for discounts.
However, be aware that custom JavaScript and Liquid solutions will be more about front-end adjustments and won’t actually block discounts from being applied in the backend or at the checkout level. You would need to enforce logic with the help of third-party apps for backend discount enforcement.
Big Commerce
In BigCommerce, removing a product from all discounts and promotions can be achieved using a combination of settings and customizations. Since BigCommerce doesn’t offer native script-based checkout customization like Shopify Plus, the approach relies on configuring settings or using APIs and custom scripts. Here’s how you can do it:
Exclude Products in Discount Rules
When setting up a discount or promotion in BigCommerce, you can explicitly exclude certain products.
Steps to Exclude Products:
-
Go to Marketing > Promotions in your BigCommerce admin.
-
Select or create a promotion (e.g., cart-level discount, coupon).
-
In the promotion setup, look for the section to set Conditions or Exclusions.
-
Add the product(s) you want to exclude by: • Product name
• Product SKU
• Product category
-
Save the promotion.
This ensures that the selected products will not be eligible for the promotion.
Exclude Products by Category or Custom Field
If you frequently need to exclude specific products, you can create a “No Discount” category or use custom fields to identify these products.
Steps:
- Create a new category called “No Discount” (optional).
- Assign the products you want to exclude to this category or use a custom field such as exclude_from_discount = true.
- In your promotions, use the Conditions or Exclusions to exclude this category or filter by custom field.
Custom Logic with BigCommerce API
If you need more control, you can use the BigCommerce API to enforce custom logic programmatically.
Steps for Custom Exclusions:
- Use the Cart API or Checkout API to monitor cart content.
- Identify products that should not receive discounts (e.g., based on product ID, SKU, or custom field).
- Write a custom script (e.g., in Node.js or PHP) to:
- Remove or reset discounts for those products.
- Adjust the total cart price accordingly.
Use Custom Checkout Scripts (Stencil)
For merchants using BigCommerce’s Stencil framework, you can use custom JavaScript to enforce discount exclusion rules at checkout.
This script disables discounts visually in the cart/checkout process. However, you’ll still need backend validation via the API.
Notes
- BigCommerce lacks a native scripting engine, so many advanced features depend on using APIs, checkout customization, or promotion exclusions.
- Ensure you test changes thoroughly to avoid disrupting legitimate discounts.
- For more advanced needs, a BigCommerce partner or developer can assist in creating a robust solution tailored to your store.