Shopify themes, liquid, logos, and UX
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hello. I need help in editing the code on my shop. I am using third party theme, but it's based on Down theme.
I have a product that has variants. Right now the price displayed on the homepage and collection is the lowest price. I want to display the highest price.
Does anybody know how I can do it?
Site: catssecret.co
Password: Baracuda99
Now it's look like this:
I need to show 100% Payment variant on home page and collections pages
Thank you
Hey @Baracuda99
To display the products from Highest Price to Lowest Price on a collection, you need to Follow these Steps:
Follow these Steps:
1) Go to Products
2) Click on Collection
3) Open the Collection from where you want to show Highest to Lowest Price Products
4) Scroll down to the bottom and Sort the Products by choosing "Highest Price"
5) Click on Save
If I managed to help you then, don't forget to Like it and Mark it as Solution!
Best Regards,
Moeed
I mean the display of the product price.
Now it shows the price as "From 500", that is, the cheapest of all options.
I need the price of the most expensive option to be displayed on the main page and the collection page
Hi I need to do this too did you ever figure it out?
Any luck?
Edit: I replied to the wrong person, sorry. Hopefully we can find a solution though.
I'm keen to find the solution to this too. Have you figured it out?
I'll post here again if I find anything in my search.
@Moeed, discover an easy solution for showcasing variant names and prices on Shopify collection pages in this YouTube video:
Nobody wants that
This may not be exactly what you're attempting to do, but in the product-block.liquid code, my theme is using the following code to select the cheapest variant:
{% assign cheapest_variant = product.variants | sort: 'price' | first %}
You could modify that logic to get the costliest_variant (or whatever you want to call it) by changing the "first" to "last" like below:
{% assign costliest_variant = product.variants | sort: 'price' | last %}
Then, where you ouptut the variant price in your template, use your new "costliest_variant" instead of the "cheapest_variant" or whatever variable is there now. For example:
<div class="product-price">
Up to: {{ costliest_variant.price | money }}
</div>
Hope that helps, cheers!
Brant
Thanks Brant. For a Shopify code newb like me, how would I navigate to that piece of code?
I'm keen to find the solution to this too. Have you figured it out?
I'll post here again if I find anything in my search.
Hey, this wasn't working for me either.
I found a solution that worked here https://stackoverflow.com/questions/70671965/shopify-dawn-theme-show-max-variant-price-on-featured-c...
Thanks! This worked for me. It did two things: 1) displays my higher price (default product) 2) removed the From text so only the price shows.
I figured this out! FYI
You'd have to find the coding that's responsible for showing the prices on your collection pages, and then edit the "money_price" value to be "money_price_max" ... so that it shows the most expensive variant price on your collection pages, instead of the cheapest variant price (which is the default).
Generally this would be under the Price.Liquid
You're looking for -
if target == product and product.price_varies
assign money_price = 'products.product.price.from_price_html' | t: price: money_price
endif
Change to -
if target == product and product.price_varies
assign money_price = 'products.product.price.from_price_html' | t: price: money_price_max
endif
Refresh the site