Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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.
Image 1
Solved! Go to the solution
This is an accepted solution.
I tried {{product.price}} and saw the numbers 500000 instead of 5000.00, seems the decimal is removed and calculated along. Adding 00 fixed the issue and is working now.
{% if product.price > 600000 %} Price on request {% endif %}
Thank you so much for your time, really appreciate it.
Hi @Arkligte
Please try to update your code to this and check again.
{% if card_product.price > 1000 %} Price on request {% endif %}
- Helpful? Like and Accept solution!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
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 %}
- Helpful? Like and Accept solution!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
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 }}
- Helpful? Like and Accept solution!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
This is an accepted solution.
I tried {{product.price}} and saw the numbers 500000 instead of 5000.00, seems the decimal is removed and calculated along. Adding 00 fixed the issue and is working now.
{% if product.price > 600000 %} Price on request {% endif %}
Thank you so much for your time, really appreciate it.
You are very welcome
- Helpful? Like and Accept solution!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
I guess you must add code like this.
{% if product.price > 600000 %} Price on request {% endif %}
- Helpful? Like and Accept solution!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
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 %}
Use this code
{% if product.price > 100000 and collection.handle == 'interior' %}
Price on request
{% else %}
{{ money_price }}
{% endif %}
- Helpful? Like and Accept solution!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
Hi, thank you for the code. Collection.handle doesn't seem to work, only the TV is tagged under interior.
Hi @Arkligte
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 %}
- Helpful? Like and Accept solution!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024