Hide unit price on collection

Topic summary

Goal: Show unit price (€/kg) only on product pages in Dawn 14.0.0, and hide it on featured collections and collection pages.

Context: The unit price element appears across collection-related views and should be suppressed everywhere except the product template.

Proposed approach: Add CSS that targets the unit price class (.unit-price) inside Liquid conditionals in theme.liquid, e.g., using {% if template == ‘product’ %} or {% unless template == ‘product’ %} to control when the CSS is applied.

Issues encountered:

  • Initial code samples had Liquid syntax mistakes (mismatched unless/endif, missing wrapper).
  • Even after correcting to a valid version (wrapping .unit-price { display: none !important; } inside an unless template == ‘product’ block), unit prices still show on collection and featured collection pages.
  • Requests were made for the store URL/password to diagnose further; none provided in the thread.

Technical notes: Liquid conditionals (if/unless) were used to conditionally load CSS; the target selector was .unit-price.

Status: No working solution yet; the behavior remains unchanged on collection pages. Discussion unresolved/ongoing.

Summarized with AI on December 19. AI used: gpt-5.

Hello,

I use Dawn 14.0.0.

I would like to show unit price (€/kg) only on product page, but not on any of featured collections and collection pages.

Any idea how to do that?

Thank you.

Hi @HelplessSoul77 , kindly share your store URL please. Thanks!

Hello @HelplessSoul77

would you like to share your store URL and password if any please.
so i can check and provide you possible solution for your question.

@HelplessSoul77 ,

  1. Go to Online Store → Theme → Edit code.
  2. Open your theme.liquid file
  3. In theme.liquid, paste the below code before
{% unless template == 'product' %}
  
{% endunless %}

If my reply is helpful, kindly click like and mark it as an accepted solution.

Thanks!

It doesn’t work. It does nothing actually.

@HelplessSoul77 Try the below:

{% if template == ‘product’ %}

.unit-price { display: none !important; }

{% endunless %}

This code is invalid.

I can’t locate

@HelplessSoul77 ,

  1. Go to Online Store → Theme → Edit code.
  2. Open your theme.liquid file
  3. In theme.liquid, paste the below code before

{% if template == ‘product’ %}
.unit-price {
display: none !important;
}
{% endif %}

I’ve check this code and it is working.

If my reply is helpful, kindly click like and mark it as an accepted solution.

Thanks!

“unless” keyword is used incorrectly as it doesn’t have a corresponding opening tag in your code

Sorry, there was a glitch during the code writing. I’ve edited the above reply. Please check it now.

Thanks for your cooperation.

@HelplessSoul77 , try both below codes one by one if any works then please like this and mark this as an accepted solution.

{% if template == ‘product’ %}
.unit-price {
display: none !important;
}
{% endif %}

OR

{% if template == ‘product’ %}

.unit-price { display: none !important; }

{% endif %}

Ok, I used the correct code, but it still doesn’t work. Prices per unit are still shown on all featured collections and collection pages. :disappointed_face:

It seems to me you’re very distracted by something because your second code is invalid again.
I changed it to

{% unless template == ‘product’ %}

.unit-price { display: none !important; }

{% endunless %}

Either way, none of your two proposing solutions work.