Hi, I want to know how to change the order, and display the crossed/original price first, and then the discounted price. My product page is showing them like I want, but in my collection page it is not. I used this code (that I found here) on product-grid-item.liquid to display the original price and the discounted price. (since Brooklyn theme doesn't has it as predetermined).
<span class="grid-product__price"> {% if product.price_varies %} {{ product.price_min | money_without_trailing_zeros }} <span class="icon-fallback-text"> <span class="icon icon-plus grid-product__price-min" aria-hidden="true"></span> <span class="fallback-text">+</span> </span> {% else %} {{ product.price | money_without_trailing_zeros }} {% endif %} </span> {% if on_sale %} <span id="ComparePrice" class="product-single__price--compare-at">{{ product.compare_at_price | money }}</span> <span class="visually-hidden">{{ 'products.general.sale_price' | t }}</span> {% else %} <span class="visually-hidden">{{ 'products.general.regular_price' | t }}</span> {% endif %}
And after using it the result is the following (in red box):
Could you please help me change the crossed amount to be displayed first?
Try swapping the code blocks, like this:
{% if on_sale %} <span id="ComparePrice" class="product-single__price--compare-at">{{ product.compare_at_price | money }}</span> <span class="visually-hidden">{{ 'products.general.sale_price' | t }}</span> {% else %} <span class="visually-hidden">{{ 'products.general.regular_price' | t }}</span> {% endif %} <span class="grid-product__price"> {% if product.price_varies %} {{ product.price_min | money_without_trailing_zeros }} <span class="icon-fallback-text"> <span class="icon icon-plus grid-product__price-min" aria-hidden="true"></span> <span class="fallback-text">+</span> </span> {% else %} {{ product.price | money_without_trailing_zeros }} {% endif %} </span>
@Emiliofp wrote:Hi, I want to know how to change the order, and display the crossed/original price first, and then the discounted price. My product page is showing them like I want, but in my collection page it is not. I used this code (that I found here) on product-grid-item.liquid to display the original price and the discounted price. (since Brooklyn theme doesn't has it as predetermined).
<span class="grid-product__price"> {% if product.price_varies %} {{ product.price_min | money_without_trailing_zeros }} <span class="icon-fallback-text"> <span class="icon icon-plus grid-product__price-min" aria-hidden="true"></span> <span class="fallback-text">+</span> </span> {% else %} {{ product.price | money_without_trailing_zeros }} {% endif %} </span> {% if on_sale %} <span id="ComparePrice" class="product-single__price--compare-at">{{ product.compare_at_price | money }}</span> <span class="visually-hidden">{{ 'products.general.sale_price' | t }}</span> {% else %} <span class="visually-hidden">{{ 'products.general.regular_price' | t }}</span> {% endif %}
And after using it the result is the following (in red box):
Could you please help me change the crossed amount to be displayed first?
either you can do it via code swapping or css, if you can give me website link, I can check with css or you will need to swap code
@ichan17 wrote:Someone please show how to show original price first and then discounted price BROOKLYN theme
please share your product page url and password if site not active yet.
Hi,
I managed to used the code below and it works perfectly fine. However, it runs really bad in my mobile. Any idea how to fix this?
{% if on_sale %} <span id="ComparePrice" class="product-single__price--compare-at">{{ product.compare_at_price | money }}</span> <span class="visually-hidden">{{ 'products.general.sale_price' | t }}</span> {% else %} <span class="visually-hidden">{{ 'products.general.regular_price' | t }}</span> {% endif %} <span class="grid-product__price"> {% if product.price_varies %} {{ product.price_min | money_without_trailing_zeros }} <span class="icon-fallback-text"> <span class="icon icon-plus grid-product__price-min" aria-hidden="true"></span> <span class="fallback-text">+</span> </span> {% else %} {{ product.price | money_without_trailing_zeros }} {% endif %} </span>
This is how my phone view looks like. Help please!
Hello, what do I need to change with the following code to make the first product variant price show instead of the lowest priced variant?
{% if on_sale %} <span id="ComparePrice" class="product-single__price--compare-at">{{ product.compare_at_price | money }}</span> <span class="visually-hidden">{{ 'products.general.sale_price' | t }}</span> {% else %} <span class="visually-hidden">{{ 'products.general.regular_price' | t }}</span> {% endif %} <span class="grid-product__price"> {% if product.price_varies %} {{ product.price_min | money_without_trailing_zeros }} <span class="icon-fallback-text"> <span class="icon icon-plus grid-product__price-min" aria-hidden="true"></span> <span class="fallback-text">+</span> </span> {% else %} {{ product.price | money_without_trailing_zeros }} {% endif %} </span>
User | Count |
---|---|
681 | |
138 | |
104 | |
63 | |
36 |