Tag products as on sale when price is lower than compare price in Shopify by using Arigato Automation
Automatically tag products 'On Sale' when variant prices drop below compare_at_price, improving product visibility.
This automation is fired when a product is updated. It loops through all the product variants and checks for any prices lower than the "compare at" price. If any of the variants have a price lower than the "compare at" price, it tags the product with the "On Sale" tag.
If the tag already exists and none of the variants meet the condition, the workflow removes the tag.
This workflow is essential in segmenting and identifying current products with reduced prices and promotions.
Pro tip: To ensure that the tagging is correct, it's necessary to run a batch workflow across all the products, initially adding the tag if required.