Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
Hello.
I am trying to create a Flow that looks at the Variant Price and the Variant Compare at Price. If the difference in price i greater than 1, then apply Sale Tag otherwise do nothing.
You can compare those prices, but you cannot do math in a condition yet.
You could potentially do that math using liquid directly in the tag action, which allows liquid.
Thanks, Paul. Do you have any guidance on how to complete that? I am more of a business admin than a developer but can copy and paste with the best of them. 🙂
It's something like:
{%- assign current_minus_one = variant.price | minus: 1 -%}
{%- if variant.compareAtPrice <= current_minus_one %}Sale{% endif -%}
Thank you, Paul. Is there a walkthrough on how to setup this flow? I am not sure how/where to add your logic. Thank you!
You would put that code directly in the add product tag action and hit enter. The structure would depend on when you need it to run, which would determine the trigger.
Sounds like that math may not be possible in a condition with flow - if you're interested in considering MESA (3rd party shopify app) for this, but we can handle that math and tag logic - and I'd be happy to setup and test the workflow for your store for you.
Thanks, Kalen. I just downloaded the app and would like to test through the free version. How would I build this flow? I have the trigger set to be when a product is updated - this should catch it. I've also got a temporary price metafield which is dependent upon a sale tag as well. I feel like the logic should be: If temporary price is not blank, then sale tag applied, if temp price is blank then if variant is on sale (difference between variant price and compare at price >1) then apply tag. If neither tests are true then remove the sale tag. Can this logic be done?
Nice! Yeah that sounds about right. You might need to loop over all the variants under the product if not doing that already.
I would have popped in and checked it myself just now but not sure what the name of your store is?
Also feel free to email me kalen@getmesa.com - I might be able to reply faster that way.
Out of curiosity what was the reason for the Sale tag in this case? Seems you can do an automated collection out of the box with just the compare at price...?
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024