Liquid, JavaScript, themes, sales channels
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?
Solved! Go to the solution
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...
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...
@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.
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 -%}
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!
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024