Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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
Hello,
Debut theme
I have a collection and I am offering 10% OFF all products and variants in this 1 collection but I do NOT want to create an automatic discount or change each variant price manually of -10%.
I would like the price on the collection page price of the product to say From $71.10 and the compare price is $79.00. So customers know the sale price and the original price in one line.
Thanks
Hello @onyx_au
Welcome to Shopify Community.
Okay, so if you just want to show the discounted price dynamically calculated it can be done via hardcoded.
{% if product.tags contains 'ABC' %}
{% assign discount_value = 10 %}
{% assign discount_amt = 100 | minus: discount_value %}
{% assign discounted_total = product.price | times: discount_amt | divided_by: 100 | round: 2 %}
{{ product.price | money }} <del>{{ discounted_total | money }}</del>
{% endif %}
Let me know if you need help in the setup.
Thanks
Hi Onyx_au,
If you don't want to create an automatic discount, and you don't want to change each variant price manually, then you have to use some type of automation, like:
A solution that only involves changing Liquid code won't be sufficient if you want the prices that customers pay to also be reduced by 10%.
Best,
Tobe