Tag Shopify Products as “On Sale” Based on Compare-at Price

5 min setup
No coding required
Runs automatically

Drive sales and attract attention to discounted products by tagging them as “On Sale” whenever the Compare-at price is higher than the actual price. This MESA workflow template automatically applies the “On Sale” tag, allowing you to create smart collections that highlight value and encourage purchases. Enhance your customers’ shopping experience and stand out from competitors by showcasing promotions effectively.

Shopify logo icon
Product Updated
Get List of Product Variants
Loop Over Variants
Check price values
Shopify logo icon
Product Add Tag

You're in good company

"MESA has been a game changer for us. And, if you ever get stuck, their support team is always super helpful."

  • Ico star
  • Ico star
  • Ico star
  • Ico star
  • Ico star
PetFriendly

"It's like Zapier but exactly designed for Shopify. I have been able to complete all the workflows that I've needed."

  • Ico star
  • Ico star
  • Ico star
  • Ico star
  • Ico star
Zailys

"The MESA team has been amazing at helping us set up our automations. We would highly recommend this app!"

  • Ico star
  • Ico star
  • Ico star
  • Ico star
  • Ico star
Rothy's

How it works

5 steps to start automatically tagging products when they go on sale

Shopify logo icon

Product Updated

App connector: Shopify • Time to complete: 0 minutes (Auto-configured)
Why this matters: This trigger monitors your Shopify store for any product changes, ensuring the workflow runs whenever product details are modified - catching pricing updates in real-time.

This step automatically detects when any product in your Shopify store gets updated, whether that's pricing changes, inventory adjustments, or other product modifications. The trigger captures the complete product data and passes it to the next step for analysis. No configuration is needed since MESA connects directly to your Shopify store's product update events. This ensures every product change gets evaluated for sale pricing without missing any updates.

Get List of Product Variants

App connector: Shopify • Time to complete: 0 minutes (Auto-configured)
Why this matters: Since products can have multiple variants (size, color, style), this step retrieves all variant pricing data to check each one individually for sale conditions.

This step automatically pulls all variants for the updated product using Shopify's API. It gathers variant-specific pricing data including regular price and compare-at price for each option. The system uses the product ID from the trigger to fetch comprehensive variant details. This data gets passed to the loop step so each variant can be individually evaluated for sale pricing conditions.

Loop Over Variants

App connector: Loop • Time to complete: 0 minutes (Auto-configured)
Why this matters: This step processes each product variant individually, ensuring that products with multiple options (like different sizes or colors) get properly evaluated for sale pricing.

The loop step takes the list of variants from the previous step and processes them one at a time. Each iteration examines an individual variant's pricing data and passes it through the remaining workflow steps. This allows products with multiple variants to have each option checked separately for sale conditions. The loop ensures no variant gets missed when determining if the overall product should be tagged as "On Sale."

Check price values

App connector: Filter • Time to complete: 0 minutes (Auto-configured)
Why this matters: This filter determines which variants qualify as "on sale" by checking if they have a compare-at price that's higher than the current selling price.

The filter step applies two conditions to each variant: first, it checks that a compare-at price exists (is not empty), and second, it verifies that the current price is less than the compare-at price. Only variants that meet both conditions proceed to the tagging action. This ensures products only get tagged as "On Sale" when they have legitimate sale pricing with a proper discount from the original price. Variants that don't meet these criteria stop here and don't trigger the tag addition.

Shopify logo icon

Product Add Tag

App connector: Shopify • Time to complete: 1 minute
Why this matters: This is where the actual tagging happens—the product gets labeled as "On Sale" in your Shopify admin, making it easy to create sale collections, filter reports, or display sale badges on your storefront.

When a variant passes the filter, this step adds the "On Sale" tag to the parent product (not the individual variant). The tag name is preset to "On Sale" but you can customize this to match your store's tagging convention—change it to "SALE", "Discounted", "Clearance", or any tag name you prefer. Find the tag field in this step and enter your desired tag name. The tag appears immediately in your Shopify admin under the product's tags section.

Ready to set this up? It only takes 5 minutes.

Our support team will even help you personalize this workflow for free.

Get started →

Make it your own!

Customize this workflow even further:

Set custom sale tags based on discount percentage
Create different tags like "20% Off" or "Clearance" by adding calculation steps that determine the discount amount and apply specific tags accordingly.
Remove sale tags when pricing returns to normal
Add a second workflow that triggers on product updates to automatically remove "On Sale" tags when the compare-at price gets cleared or when prices return to regular levels.
Send notifications when products go on sale
Connect email or Slack steps to alert your marketing team whenever high-value products get tagged as on sale, helping coordinate promotional campaigns.
Track sale performance in spreadsheets
Add Google Sheets integration to log each time a product goes on sale, including timestamps, discount amounts, and variant details for sales analysis.

Common questions

Will this workflow tag products that don't actually have discounted pricing?

What happens if a product has some variants on sale and others at regular price?

Can I customize the "On Sale" tag to something else?

Ready to start automatically tagging products when they go on sale?

7-day free trial • 5 min setup • Cancel anytime

Need help? Our automation experts will help you personalize this workflow for free. Contact support