Solved

Narrative Theme: Remove Price When It's Zero

Kay30
Excursionist
42 3 8

I want to remove the price for products on the product card when the price is zero.  I basically don't want to show zeros when the product is free.  Can someone help me please?

Accepted Solution (1)

neeravmakwana
Shopify Partner
164 30 39

This is an accepted solution.

Hi, please find the following in product-grid-item.liquid file:

<p class="product__grid__title">{{ product.title }}</p>

Add {% if current_variant.price >0 %} just below it in a new line.

 

Then, similarly find <span class="unit small">{{ current_variant.unit_price | money }}{{ unit_price_separator }}{{ unit_price_base_unit }}</span>

and add {% endif %} in a new line just below it.

 

If this does not solveyour problem entirely, you may need to make a similar change in product-liquid file after <span data-product-price...

View solution in original post

Replies 5 (5)

neeravmakwana
Shopify Partner
164 30 39

This is an accepted solution.

Hi, please find the following in product-grid-item.liquid file:

<p class="product__grid__title">{{ product.title }}</p>

Add {% if current_variant.price >0 %} just below it in a new line.

 

Then, similarly find <span class="unit small">{{ current_variant.unit_price | money }}{{ unit_price_separator }}{{ unit_price_base_unit }}</span>

and add {% endif %} in a new line just below it.

 

If this does not solveyour problem entirely, you may need to make a similar change in product-liquid file after <span data-product-price...

Kay30
Excursionist
42 3 8

@neeravmakwana Thank you.  The solution worked.  I just had to go to a different file and also look for the price code as it was a little different than what you provided.  I am tech savvy so I was able to figure it out using the information you gave me. 

neeravmakwana
Shopify Partner
164 30 39

That's wonderful. I hope this time my instructions are better.

Can you please search for <p class="product__price text-center{% if current_variant_sale %} product__price in featured-product.liquid and {% if current_variant.price >0 %} just above it.

Just after that class ends (</p> around line 91), please add {%- endif -%}

janiecolbaugh
Shopify Partner
15 1 3

Hello, I need to remove the price from being displayed with the product price is set to zero. I have attempted to use the info above but I do not have that particular snippet as an option. I have also searched for that code to no avail.  I am using the Express theme. I would greatly appreciate your assistance. Many thanks! 

neeravmakwana
Shopify Partner
164 30 39
Hi, can you please create a new topic/thread for this. That will help
others trying to do this for express theme.

Thanks.

(please send me a private/direct message when the new topic is created).