I'm looking to display a few different price types on the product list page:
I've been fiddling with elsif statements in the product-block.liquid file. I was able to get the all the options to work, except when it's only regular price (no variants). It will show a price like $24.95 - $24.95 even though the product doesn't have variants.
I've attached a screenshot below for what I'd like to have. Any help is much and greatly appreciated.
Hi @torasaki,
You can try checking if your product only has a default variant, like so:
{% if product.has_only_default_variant %}
{{ product.price | money_with_currency }}
{% elsif %}
..........
{% else %}
..........
{% endif %}
Inside the first statement you can also include another one, if product.compare_at_price > product.price, etc. in order to get all of the possible options you need.
User | Count |
---|---|
25 | |
20 | |
19 | |
16 | |
15 |