Show Sale Price on Category Page

Hello Everyone and thank you for taking the time to read this and I really appreciate your help.

My site is: https://rusticfarmhousedesign.com/collections/all

Currently have an auto coupon setup at checkout which is 20% off.

I would like to be able to show the sale price on the collections page for each product on the page mentioned above.

I was able to get the sale price to show on the product display page with the following code changes below

In the Debut theme, I changed the product-price.liquid file and it worked perfectly .. just 2 line changes:

This is the first 10 lines of the file. In bold is what needs to be changed.

---------ORIGINAL--------------

{% if variant.title %}

{%- assign compare_at_price = variant.compare_at_price -%}

{%- assign price = variant.price -%}

{%- assign available = variant.available -%}

{% else %}

{%- assign compare_at_price = 1999 -%}

{%- assign price = 1999 -%}

{%- assign available = true -%}

{% endif %}

The following changes in red make every single product be 20% off which is what I needed. If I want to change it to 10% off I change the “times: 0.8 => times: 0.9”. This causes the original price to have a line through it then the sale price is next to it with the word “Sale”. Note: I already had created a 20% discount on the Discounts page which already makes the discount in the cart. If you don’t want it to show any sale price, just change the “times: 0.8 => times: 1.0”. This change below now shows the discount on the collection pages and on the product pages.

---------CHANGES IN RED--------------

{% if variant.title %}

{%- assign compare_at_price = variant.price -%}

{%- assign price = variant.price | times: 0.8 -%}

{%- assign available = variant.available -%}

{% else %}

{%- assign compare_at_price = 1999 -%}

{%- assign price = 1999 -%}

{%- assign available = true -%}

{% endif %}

Hi,

The way that you have implemented it is not recommended. You will simply display a 20% sale price always no matter what happens in the future - maybe you want a product to be 10% off?

This guide on here seems relevant Tutorial: Displaying Saved Amount/Percentage on the Sale Badge - Shopify Community

Thanks for sending this over @jordanholmes

I tried both the price code and the percentage code replacing {{ ‘products.product.on_sale’ | t }} in both ‘product-price-listing.liquid’ and ‘product-price.liquid’. and nothing changed on our site.

Hello,

I see now what you are doing! I thought you were putting the items on sale but instead you are giving a discount.

The compare_at_price is therefore not relevant and won’t show any changes if the product is not on sale.

I think what you want to do might confuse customers as when they add to their cart it will show the original amount again - unless you also change the code there.

I would either just remove the discount and put the items on a 20% sale or just have the 20% off message in the announcement bar.