Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hi - I want to create a flow that auto creates a tag based on the discounted price of a product - so it would need to do a calculation [(price / compare at price) - 1] - is this possible?
any advice gratefully received!
thanks
Yes, possible. You likely need to put Liquid in the tag field (and hit enter to save the tag). Something like:
{{ productVariant.price | divided_by: productVariant.compareAtPrice | minus: 1 }}
One note...depending on the trigger you may not have access to productVariant, or you'll need to loop over lineItems (for orders) or variants (for product triggers)
Hi Paul - great - I want to round the discount level in the tag but am getting an error
I think you need to move the round inside the curly brackets. Try:
{{ productVariant.price | divided_by: productVariant.compareAtPrice | minus: 1 | round: 2 }}
To learn more visit the Shopify Help Center or the Community Blog.