Call for price instead of $0.00

SCBRacing
New Member
1 0 0

Hi - I have been trying to change our one product page price from $0.00 to 'call for price'. Any idea how to get it right?

URL:  https://www.sportscarboutique.com/collections/wheels

Replies 7 (7)
Ninthony
Shopify Partner
2247 339 900

You'll have to go into both your collection-template.liquid file and product-template.liquid file and find where the price occurs in the code and make a condition around it:

{% if product.price > 0 %}
  {{ product.price | money }}
{% else %}
  Call for pricing
{% endif %}

 

Obviously it's not going to look exactly like this, but that's the general idea. Duplicate your theme, then go into the duplicate and open up those files. Ctrl + F and search for "price" and look for something that kind of looks like what I showed above "{{ product.price }}" or even "{{ variant.price }}" -- put something next to it like a string of characters "aaaaa" and save the file. Refresh and if you see the string of characters appear next to the price you'll know you're in the right spot. Then wrap the condition around it.

If my solution helped you, please like it and accept it as the solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
Hannahdahl
Tourist
4 0 1

I read on another blog post that you needed to go in and create a new template, as well as a new section if you wanted to change the price for some items (ie; I have a few items on my store that I'd like to keep as 'call for price'.) Will this method work instead? It's not clear to me where I need to rewrite the code if I just open a new template, as it doesn't show any prices--only this:

{% section 'product-template' %}
{% section 'product-recommendations' %}
{% section 'product-collection-links' %}

Ninthony
Shopify Partner
2247 339 900

You could make new files and do it that way, but the way I posted will also work. {% section 'product-template' %} is where you'll find the price for your product page. In the sections folder there will be a file called "product-template.liquid". If you want I can just do this for you real quick, wouldn't take much time. I'll just need to request access to your themes. I'll duplicate your live theme and then make the changes on the duplicate and you can preview them before publishing. If that's ok let me know and I'll request access.

If my solution helped you, please like it and accept it as the solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
Hannahdahl
Tourist
4 0 1

Thanks for the quick response! I appreciate the offer for help. If I do this, will it affect all the items in my store? Is there a way to toggle between the two themes once I've made a duplicate, so that I can apply the 'no price' option to individual products?

Ninthony
Shopify Partner
2247 339 900

The way that I posted would only affect prices that are equal to or less than 0. Any changes you make on your duplicate will not affect your live store, so just don't publish the theme until you have everything working the way you want to. Another way you could do this is to tag your products that you do not want to have a price with something like "no-price". Then in your code you can say:

 

{% unless product.tags contains 'no-price' %}
  {{ product.price }}
{% else %}
  Call for pricing.
{% endunless %}

 

That way if you ever don't want to show a price on your product all you would have to do is tag it "no-price". There's multiple ways you can do it, if you were to go the route of making an alternate product-template and collection-template, you'd need to go through all your products and collections individually and apply the alternate template to them through the admin which could be a pain. This way, you only have to make one adjustment in the code, and you can bulk edit the products and add the tag to all of them at once. 

If my solution helped you, please like it and accept it as the solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
dh722
Tourist
3 0 0

collection-template.liquid file and product-template.liquid file

These don't exist [anymore?] ~ 

dh722_0-1635065353484.png

 

Ninthony
Shopify Partner
2247 339 900

It really depends on the theme, they exist in most themes. You might want to look in collection.liquid -- that is the very base file that is output on all collection pages. It's just a typical practice that instead of finding any code in collection.liquid, when you open the file typically it points to another file:

 

{% section 'collection-template' %}

 

The reason being is that in section files you can include a schema, which allows the client more of an ability to edit the collection pages themselves through the customize editor. So check collection.liquid

If my solution helped you, please like it and accept it as the solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D