Display Sale Price and Original Price in Collections

Charlooney
New Member
10 0 0

Hello all!

 

I am attempting to get the sale price to display on the collection pages, it only shows currently on the product page. https://www.chocolatedispensary.com/collections/sale

 

Screenshot 2024-05-23 at 11.39.00 AM.png

 

I've attempted to modify the product-block.liquid file with the following, but nothing changed.

 

<div class="price">
  {% if product.price_varies %}{{ 'products.listing.from' | t }}{% endif %}
  {% if on_sale %}
    <span class="was-price theme-money">
      {%- render "price", price: cheapest_variant.compare_at_price -%}
    </span>
    <span class="theme-money sale-price">
      {%- render "price", price: cheapest_variant.price -%}
    </span>
  {% else %}
    <span class="theme-money">
      {%- render "price", price: cheapest_variant.price -%}
    </span>
  {% endif %}
  {% render 'unit-price', variant: cheapest_variant %}
</div>

Am I editing the incorrect file or is there something missing in the code?

 

Thanks in advance!

Replies 6 (6)

AnneLuo
Shopify Partner
637 128 130

Hi, @Charlooney 

I can help you with it. So I need to access your store as a collaborator if possible. 

If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.
- Feel free to Email Me   

Buy Me A Coffee

Charlooney
New Member
10 0 0

Hello @AnneLuo !

 

Thanks so much for offering to help! Unfortunately, I cannot provide access, but am happy to provide information that you need. 

 

Thanks!

AnneLuo
Shopify Partner
637 128 130

Hi. Maybe the problem is here. How does this variable take its value?

AnneLuo_0-1716866975953.png

 

If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.
- Feel free to Email Me   

Buy Me A Coffee

Charlooney
New Member
10 0 0

Hello @AnneLuo 

 

I'm not quite sure what you mean. The products are registering as on-sale, are showing the on-sale banners, and are showing up in the sale collection. The issue is that only the sale price shows, not the compare at price, which it seems that code has indicated it would, but I am relatively new to Liquid coding.

 

Warm Regards,
Charlene

AnneLuo
Shopify Partner
637 128 130

So If you are not familiar with code editing, consider seeking a developer assistance for guidance.

If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.
- Feel free to Email Me   

Buy Me A Coffee

Charlooney
New Member
10 0 0

Hello @AnneLuo 

 

Sorry? That's why I came to the forum, to seek assistance and to learn more about Liquid -- it's been a great resource for me thus far. I didn't expect to be rudely told to go elsewhere. Everyone has to start somewhere.

 

Regards,

Charlene