Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Re: Product Price Range

Solved

How can I display a price range for product options without apps?

KLC
Shopify Partner
6 0 2

I have products that need to show a range of prices based on the option that they choose. 

Medium armored shirt is $193

A Medium un-armored shirt is $93

3XL shirt armored is $209
A 3XL un-armored shirt is $109

 

I want the price on the product page to be a range of $93-209 but I do not see any way to do this without having to install an app and I worry the apps may not play well with others. 

Any help would be great. 

Accepted Solution (1)

Made4uo-Ribe
Shopify Partner
9035 2160 2664

This is an accepted solution.

Hi @KLC 

 

The simple code I can think about is using map and sort. And I assume you are using theme with custom liquid enable to make it simpler to add. Please follow the instructions below. 

 

  • From your Shopify admin dashboard, click on "Online Store" and then "Themes".
  • Find the theme that you want to edit and click on "Customize".
  • Go to your product page, and add a "Custom liquid" block. 
  • Place the the code below in the textfield provided 
{% assign price_range = product.variants | map: "price" | sort %}
{{ price_range.first | money }} - {{  price_range.last | money }}

 

See image for reference:

Made4uoRibe_0-1698271296623.png

 

If this fixed your issue, Likes and Accept as Solution are highly appreciated. Coffee tips fuel my dedication.
Get experienced Shopify developers at affordable rates—visit Made4Uo.com for a quick quote!
Need THEME UPDATES but have custom codes? No worries, for an affordable price.
Create custom Shopify pages effortlessly with PageFly's drag-and-drop ⚙️.

View solution in original post

Replies 3 (3)

Made4uo-Ribe
Shopify Partner
9035 2160 2664

This is an accepted solution.

Hi @KLC 

 

The simple code I can think about is using map and sort. And I assume you are using theme with custom liquid enable to make it simpler to add. Please follow the instructions below. 

 

  • From your Shopify admin dashboard, click on "Online Store" and then "Themes".
  • Find the theme that you want to edit and click on "Customize".
  • Go to your product page, and add a "Custom liquid" block. 
  • Place the the code below in the textfield provided 
{% assign price_range = product.variants | map: "price" | sort %}
{{ price_range.first | money }} - {{  price_range.last | money }}

 

See image for reference:

Made4uoRibe_0-1698271296623.png

 

If this fixed your issue, Likes and Accept as Solution are highly appreciated. Coffee tips fuel my dedication.
Get experienced Shopify developers at affordable rates—visit Made4Uo.com for a quick quote!
Need THEME UPDATES but have custom codes? No worries, for an affordable price.
Create custom Shopify pages effortlessly with PageFly's drag-and-drop ⚙️.
KLC
Shopify Partner
6 0 2

WOW, awesome!!! Thank you very much. 🙂 

magriguez
Shopify Partner
4 0 4

That's great! Any advice on how to make it hide on products that don't have a price variant? Thank you.