How can I set price_varies to true in product pricing?

Solved

How can I set price_varies to true in product pricing?

gr_trading
Shopify Partner
1891 145 199

Hi, There are so many community posts event in the Shopify cheat sheet explain how to use

 

 

 

<h2>price_min:{{ product.price_min }} || price_max:{{ product.price_max }} || price:{{ product.price }} || price_varies: {{ product.price_varies }}</h2>

 

 

 

I'm wondering how I can set price_varies to true.

 

Please help...

For any custom development WhatsApp or connect at Email ID: gr.trading15@gmail.com for quick consultation. | Shopify Free codes
To support Buy Me a Coffee
Accepted Solution (1)

MaxDesign
Shopify Partner
213 15 84

This is an accepted solution.

price_varies is a value you get from the liquid product object, not a value you set. You can find the documentation about product.price_varies here.


As the documentation states, {{ product.price_varies }} returns true if the product's variant prices vary. Returns false if not. 

 

If you want price_varies to be true, then the product needs to have multiple variants with different prices.

 

Reach out to me at admin@maxdesign.expert

View solution in original post

Replies 3 (3)

MaxDesign
Shopify Partner
213 15 84

This is an accepted solution.

price_varies is a value you get from the liquid product object, not a value you set. You can find the documentation about product.price_varies here.


As the documentation states, {{ product.price_varies }} returns true if the product's variant prices vary. Returns false if not. 

 

If you want price_varies to be true, then the product needs to have multiple variants with different prices.

 

Reach out to me at admin@maxdesign.expert
gr_trading
Shopify Partner
1891 145 199

Hi @MaxDesign 

 

Thanks for your quick response.

 

Request you to refer the below product JSON

 

https://shoponcliq.com/products/personalized-blue-whale-slim-phone-case-cover.json

 

Which has multiple variants but still missing the price_varies field missing.

 

For any custom development WhatsApp or connect at Email ID: gr.trading15@gmail.com for quick consultation. | Shopify Free codes
To support Buy Me a Coffee
MaxDesign
Shopify Partner
213 15 84

You need to access the price_varies value with javascript? In that case you could parse it from a script tag, for instance:

<script type="application/json">
  {{ product | json }}
</script>
Reach out to me at admin@maxdesign.expert