Hey all, I need to have my store switch the pricing a little. Right now its the compare price is on the left, and actually price on the right. Can someone assist with this?
Please let us know which theme you are using. Also send the store URL so we can help.
I am using the north theme, my website is lifegetseasy4u.com Here is the code for my product-price.liquid
{% comment %}
Renders a list of product’s price (regular, sale)
Accepts:
- product: {Object} Product Liquid object (optional)
- use_variant: {Boolean} Renders selected or first variant price instead of overall product pricing (optional)
- price_class: {String} Adds a price class to the price element (optional)
Usage:
{% render ‘price’, product: product %}
{% endcomment %}
{%- liquid
if use_variant
assign target = product.selected_or_first_available_variant
else
assign target = product
endif
assign compare_at_price = target.compare_at_price
assign price = target.price | default: 1999
assign money_price = price | money
if settings.currency_code_enabled
assign money_price = price | money_with_currency
endif
if target == product and product.price_varies
assign money_price = ‘products.product.from_price_html’ | t: price: money_price
endif
-%}
{%- unless product.price_varies == false and product.compare_at_price_varies %}
{% if compare_at_price != null %}
{% if settings.currency_code_enabled %}
{{ compare_at_price | money_with_currency }}
{% else %}
{{ compare_at_price | money }}
{% endif %}
{% endif %}
{%- endunless -%}
{{ money_price }}
{{- product.selected_or_first_available_variant.unit_price | money -}}
/
{%- if product.selected_or_first_available_variant.unit_price_measurement.reference_value != 1 -%}
{{- product.selected_or_first_available_variant.unit_price_measurement.reference_value -}}
{%- endif -%}
{{ product.selected_or_first_available_variant.unit_price_measurement.reference_unit }}
{% comment %}
Renders a list of product's price (regular, sale)
Accepts:
- product: {Object} Product Liquid object (optional)
- use_variant: {Boolean} Renders selected or first variant price instead of overall product pricing (optional)
- price_class: {String} Adds a price class to the price element (optional)
Usage:
{% render 'price', product: product %}
{% endcomment %}
{%- liquid
if use_variant
assign target = product.selected_or_first_available_variant
else
assign target = product
endif
assign compare_at_price = target.compare_at_price
assign price = target.price | default: 1999
assign money_price = price | money
if settings.currency_code_enabled
assign money_price = price | money_with_currency
endif
if target == product and product.price_varies
assign money_price = 'products.product.from_price_html' | t: price: money_price
endif
-%}
<ins>{{ money_price }}</ins>
{%- unless product.price_varies == false and product.compare_at_price_varies %}
{% if compare_at_price != null %}
<del>
{% if settings.currency_code_enabled %}
{{ compare_at_price | money_with_currency }}
{% else %}
{{ compare_at_price | money }}
{% endif %}
</del>
{% endif %}
{%- endunless -%}
<small>
{{- product.selected_or_first_available_variant.unit_price | money -}}
/
{%- if product.selected_or_first_available_variant.unit_price_measurement.reference_value != 1 -%}
{{- product.selected_or_first_available_variant.unit_price_measurement.reference_value -}}
{%- endif -%}
{{ product.selected_or_first_available_variant.unit_price_measurement.reference_unit }}
</small>
Please replace the code with the above and see
Have edited the above code to add some explicit space, you can see this portion, try and add or remove these and you will see the difference. This should be good enough
"
These are fine, I replaced the code above and removed the &nbs. For some reason on the product page, its not working now. but on my collections page where it shows all my products, its perfect but not the actually product page. For some reason on the image above from the post i sent it works, but its just not spaced right, but if i go to another product it is not working.I am not editing this on my live theme, its a copy so you man not see it if you were to inspect it.
Here is the copy
{% comment %}
Renders a list of product’s price (regular, sale)
Accepts:
- product: {Object} Product Liquid object (optional)
- use_variant: {Boolean} Renders selected or first variant price instead of overall product pricing (optional)
- price_class: {String} Adds a price class to the price element (optional)
Usage:
{% render ‘price’, product: product %}
{% endcomment %}
{%- liquid
if use_variant
assign target = product.selected_or_first_available_variant
else
assign target = product
endif
assign compare_at_price = target.compare_at_price
assign price = target.price | default: 1999
assign money_price = price | money
if settings.currency_code_enabled
assign money_price = price | money_with_currency
endif
if target == product and product.price_varies
assign money_price = ‘products.product.from_price_html’ | t: price: money_price
endif
-%}
{{ money_price }}
{%- unless product.price_varies == false and product.compare_at_price_varies %}
{% if compare_at_price != null %}
{% if settings.currency_code_enabled %}
{{ compare_at_price | money_with_currency }}
{% else %}
{{ compare_at_price | money }}
{% endif %}
{% endif %}
{%- endunless -%}
{{- product.selected_or_first_available_variant.unit_price | money -}}
/
{%- if product.selected_or_first_available_variant.unit_price_measurement.reference_value != 1 -%}
{{- product.selected_or_first_available_variant.unit_price_measurement.reference_value -}}
{%- endif -%}
{{ product.selected_or_first_available_variant.unit_price_measurement.reference_unit }}




