All things Shopify and commerce
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
I would like any product set to $0.00 to say, "Call For Pricing". I am using the simple theme. We were using an app, but they recently tried to fix one product and ended up messing up all of our other products. What code do I use and where does it go?
Solved! Go to the solution
This is an accepted solution.
To replace the product price with "Call For Pricing" for any product set to $0.00 in a Shopify store using the Simple theme, you will need to modify your theme's code. Here is how you can do it:
Access Your Theme Code:
Locate the Product Price Code:
Edit the Product Price Code:
Add Conditional Logic:
Here's a sample code snippet to get you started:
{% assign product_price = product.price | money_without_currency | remove: ',' | remove: '.' | plus: 0 %}
{% if product_price == 0 %}
<span class="price">Call For Pricing</span>
{% else %}
<span class="price">{{ product.price | money }}</span>
{% endif %}
This is an accepted solution.
@AmericanLadders thanks for posting here.
yes it is possible with liquid code. please use this code I hope it will help you.
{% if product.available %}
{% if product.price == 0 %}
<a href="tel:12345678" class="product-price">Call for price</a>
{% else %}
<span class="product-price">{{ product.price | money }}</span>
{% endif %}
{% endif %}
let me know if you face any issue.
This is an accepted solution.
@AmericanLadders Put the above code 🧑💻 in the area of price
This is an accepted solution.
@AmericanLadders Put the above code 🧑💻 in the area of price
also use <a> tag with your number to creat cal popup
popup
{% if product.available %}
{% if product.price == 0 %}
<a href="tel:12345678" class="product-price">Call for price</a>
{% else %}
<span class="product-price">{{ product.price | money }}</span>
{% endif %}
{% endif %}
This is an accepted solution.
To replace the product price with "Call For Pricing" for any product set to $0.00 in a Shopify store using the Simple theme, you will need to modify your theme's code. Here is how you can do it:
Access Your Theme Code:
Locate the Product Price Code:
Edit the Product Price Code:
Add Conditional Logic:
Here's a sample code snippet to get you started:
{% assign product_price = product.price | money_without_currency | remove: ',' | remove: '.' | plus: 0 %}
{% if product_price == 0 %}
<span class="price">Call For Pricing</span>
{% else %}
<span class="price">{{ product.price | money }}</span>
{% endif %}
Thank you!! I got it to say call for price but not where we wanted it. It says call for price above the product image, but we'd like it replace the $0 so the $0 does not show
This is an accepted solution.
@AmericanLadders Put the above code 🧑💻 in the area of price
This is an accepted solution.
@AmericanLadders Put the above code 🧑💻 in the area of price
also use <a> tag with your number to creat cal popup
popup
{% if product.available %}
{% if product.price == 0 %}
<a href="tel:12345678" class="product-price">Call for price</a>
{% else %}
<span class="product-price">{{ product.price | money }}</span>
{% endif %}
{% endif %}
I got it in the right spot but the $0.00 is still showing
@AmericanLadders Can you please share SS how you puting this code
Alright now pic bottom code and put in else
I keep getting errors
@AmericanLadders Can you please put whole file code here the i will set the code
This is an accepted solution.
@AmericanLadders thanks for posting here.
yes it is possible with liquid code. please use this code I hope it will help you.
{% if product.available %}
{% if product.price == 0 %}
<a href="tel:12345678" class="product-price">Call for price</a>
{% else %}
<span class="product-price">{{ product.price | money }}</span>
{% endif %}
{% endif %}
let me know if you face any issue.
@AmericanLadders This