How to show set % percentage sale price on all variants/collection?

onyx_au
Explorer
68 1 20

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

Replies 2 (2)

Sweet_Savior_3
Shopify Partner
1201 96 116

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

Don't forget to like and accept the solution to help others store owners.
Looking for an expert or Have any queries ? Send query to the Inbox
Coffee Tip ? Pay to shopify.dev.34@gmail.com
From Less To Further !!!

tobebuilds
Shopify Partner
272 13 75

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 custom script
  • An app (there are many bulk editing apps out there)

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