How do I replace my product price to say call for price?

Solved

How do I replace my product price to say call for price?

AmericanLadders
Tourist
7 0 1

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?

Accepted Solutions (4)

ihsfr
Shopify Partner
14 1 1

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:

  1. Access Your Theme Code:

    • In your Shopify admin, go to Online Store > Themes.
    • Find the Simple theme and click Actions > Edit code.
  2. Locate the Product Price Code:

    • In the left sidebar, under Sections, look for a file named product-template.liquid or product.liquid. The exact file name can vary depending on the theme version.
  3. Edit the Product Price Code:

    • Open the product-template.liquid file.
    • Look for the section of code that displays the product price. It often includes {{ product.price | money }} or similar.
  4. Add Conditional Logic:

    • Replace the price display code with conditional logic to check if the price is $0.00 and display "Call For Pricing" instead.

 

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 %}

 

 

Want to improve your Facebook Pixels or TikTok Pixels performance? Give us a try: https://apps.shopify.com/partners/galacticapps

View solution in original post

ProtoMan44
Shopify Partner
510 43 80

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.

- A thirsty developer passionate about supporting the community. If you'd like to, you can  

Buy me a Coffee.


- Your Shopify Solution Specialist Get a Quote at

ProtoMan44

 - 

Chat On Whatsapp


Crafting exceptional e-commerce experiences to elevate your online presence. Let's build your success story together!

View solution in original post

ProtoMan44
Shopify Partner
510 43 80

This is an accepted solution.

@AmericanLadders  Put the above code 🧑‍💻 in the area of price

- A thirsty developer passionate about supporting the community. If you'd like to, you can  

Buy me a Coffee.


- Your Shopify Solution Specialist Get a Quote at

ProtoMan44

 - 

Chat On Whatsapp


Crafting exceptional e-commerce experiences to elevate your online presence. Let's build your success story together!

View solution in original post

ProtoMan44
Shopify Partner
510 43 80

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 %}

 

- A thirsty developer passionate about supporting the community. If you'd like to, you can  

Buy me a Coffee.


- Your Shopify Solution Specialist Get a Quote at

ProtoMan44

 - 

Chat On Whatsapp


Crafting exceptional e-commerce experiences to elevate your online presence. Let's build your success story together!

View solution in original post

Replies 13 (13)

ihsfr
Shopify Partner
14 1 1

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:

  1. Access Your Theme Code:

    • In your Shopify admin, go to Online Store > Themes.
    • Find the Simple theme and click Actions > Edit code.
  2. Locate the Product Price Code:

    • In the left sidebar, under Sections, look for a file named product-template.liquid or product.liquid. The exact file name can vary depending on the theme version.
  3. Edit the Product Price Code:

    • Open the product-template.liquid file.
    • Look for the section of code that displays the product price. It often includes {{ product.price | money }} or similar.
  4. Add Conditional Logic:

    • Replace the price display code with conditional logic to check if the price is $0.00 and display "Call For Pricing" instead.

 

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 %}

 

 

Want to improve your Facebook Pixels or TikTok Pixels performance? Give us a try: https://apps.shopify.com/partners/galacticapps
AmericanLadders
Tourist
7 0 1

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 Screenshot 2024-06-13 132944.png

ProtoMan44
Shopify Partner
510 43 80

This is an accepted solution.

@AmericanLadders  Put the above code 🧑‍💻 in the area of price

- A thirsty developer passionate about supporting the community. If you'd like to, you can  

Buy me a Coffee.


- Your Shopify Solution Specialist Get a Quote at

ProtoMan44

 - 

Chat On Whatsapp


Crafting exceptional e-commerce experiences to elevate your online presence. Let's build your success story together!
ProtoMan44
Shopify Partner
510 43 80

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 %}

 

- A thirsty developer passionate about supporting the community. If you'd like to, you can  

Buy me a Coffee.


- Your Shopify Solution Specialist Get a Quote at

ProtoMan44

 - 

Chat On Whatsapp


Crafting exceptional e-commerce experiences to elevate your online presence. Let's build your success story together!
AmericanLadders
Tourist
7 0 1

I got it in the right spot but the $0.00 is still showing Screenshot 2024-06-13 134627.png

ProtoMan44
Shopify Partner
510 43 80

@AmericanLadders  Can you please share SS how you puting this code 

- A thirsty developer passionate about supporting the community. If you'd like to, you can  

Buy me a Coffee.


- Your Shopify Solution Specialist Get a Quote at

ProtoMan44

 - 

Chat On Whatsapp


Crafting exceptional e-commerce experiences to elevate your online presence. Let's build your success story together!
AmericanLadders
Tourist
7 0 1

Screenshot 2024-06-13 135319.png

ProtoMan44
Shopify Partner
510 43 80

Alright now  pic bottom code and put in else

@AmericanLadders 

- A thirsty developer passionate about supporting the community. If you'd like to, you can  

Buy me a Coffee.


- Your Shopify Solution Specialist Get a Quote at

ProtoMan44

 - 

Chat On Whatsapp


Crafting exceptional e-commerce experiences to elevate your online presence. Let's build your success story together!
AmericanLadders
Tourist
7 0 1

I keep getting errors

ProtoMan44
Shopify Partner
510 43 80

@AmericanLadders Can you please put whole file code here the i will set the code

- A thirsty developer passionate about supporting the community. If you'd like to, you can  

Buy me a Coffee.


- Your Shopify Solution Specialist Get a Quote at

ProtoMan44

 - 

Chat On Whatsapp


Crafting exceptional e-commerce experiences to elevate your online presence. Let's build your success story together!
AmericanLadders
Tourist
7 0 1

          

ProtoMan44
Shopify Partner
510 43 80

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.

- A thirsty developer passionate about supporting the community. If you'd like to, you can  

Buy me a Coffee.


- Your Shopify Solution Specialist Get a Quote at

ProtoMan44

 - 

Chat On Whatsapp


Crafting exceptional e-commerce experiences to elevate your online presence. Let's build your success story together!
ProtoMan44
Shopify Partner
510 43 80

@AmericanLadders This

- A thirsty developer passionate about supporting the community. If you'd like to, you can  

Buy me a Coffee.


- Your Shopify Solution Specialist Get a Quote at

ProtoMan44

 - 

Chat On Whatsapp


Crafting exceptional e-commerce experiences to elevate your online presence. Let's build your success story together!