How to Display "Price on Request" when price is more than 500

Hi,

How to display “price on request” in collection when price is more than 1000.

I used following code to reflect image 1. It doesnt take the following condition and reflects for all products.

{% if money_price > “1000” %} Price on request {% endif %}

If I input 1000 as integer, I get this error “Comparison Of Integer With String Failed”. Need help.

Hello @seeyoutom

This is Amelia at PageFly - Shopify Advanced Page Builder app.

Please try to update your code to this and check again.

{% if card_product.price > 1000 %} Price on request {% endif %}

Hoping my solution helps you solve your problem.

Best regards,

Amelia | PageFly

1 Like

Hi, than you for the reply.

I tried the given code. It removes the price completely as shown in below image.

Played with the conditions to check if it works but sadly it doesn’t. I am unable to figure out why the operator isn’t working. I am currently replacing {{money_price}} to the code and I am in price.liquid file.

So please try to use this code

{% if product.price > 1000 %} Price on request {% endif %}
1 Like

Thank you, the condition doesn’t seem to work strangely.

I am currently using {% if product.price > 6000 %} Price on request {% endif %} and got the below result.

End result I am looking for is "First image should only show the price (as its lesser than 6000) and second image should show “Price on request” (as its greater).

Am using sense theme at the moment.

Please try to add this code before the that code to check what value of your item’s price

{{ product.price }}
1 Like

Hi,

With custom JavaScript development, this functionality can be implemented on Shopify beyond its default capabilities.

Terence.

Hi, Quick question.

Condition is, if a collection called “INTERIOR” (handle is ‘interior’) has products that cost more than 1000, it should show “price on request”. I am using following codes, but it’s not working. Rest of the collection should show regular prices without any condition.

Tried this one

{% assign collection_handle = ‘interior’ %}
{% if product.price > 100000 and collections[collection_handle].products %} Price on request
{% else %}
{{ money_price }}
{% endif %}

Tried this one too

{% assign collection_handle = ‘interior’ %}
{% for product in collections[collection_handle].products %}
{% if product.price > 100000 %} Price on request
{% else %}
{{ money_price }}
{% endif %}
{% endfor %}

You can use this code

{% if product.price > 100000 and collection.handle == 'interior' %} 
Price on request
{% else %}
{{ money_price }}
{% endif %}
1 Like

Hi, thank you for the code. Collection.handle doesn’t seem to work, only the TV is tagged under interior.

Hi @seeyoutom

Please update the code

{% assign productCollections = card_product.collections | map: "handle" %}
{% if productCollections contains 'interior' %}
  {% if product.price > 100000 %} 
    Price on request
  {% else %}
    {{ money_price }}
  {% endif %}
{% endif %}
1 Like