{% comment %} Renders a list of product's price (regular, sale, unit) Accompanies product forms and meant to be updated dynamically Accepts: - variant: {Object} Variant Liquid object (optional) - product: {Object} Product Liquid object (optional) - show_vendor: {Boolean} Show the product's vendor depending on the section setting (optional) Usage: {% render 'product-price', variant: current_variant, product: product %} {% endcomment %} {%- liquid if variant.title assign compare_at_price = variant.compare_at_price assign price = variant.price assign available = variant.available else assign compare_at_price = 1999 assign price = 1999 assign available = true endif comment start Yagi app code endcomment if variant.title assign price = variant.price assign compare_at_price = variant.compare_at_price assign price = variant.metafields.app--168074346497.auto_discounted_price.value | default: variant.price if price < variant.price and compare_at_price == 0 or compare_at_price == blank assign compare_at_price = variant.price endif endif comment end Yagi app code endcomment if settings.currency_code_enable assign money_price = price | money_with_currency else assign money_price = price | money endif -%}
{% if show_vendor and product %}
{{ 'products.product.vendor' | t }} {{ product.vendor }}
{% endif %} {% unless product.price_max == 0 and settings.custom_price0_text != blank %}
{{ 'products.product.regular_price' | t }} {% if price == 0 and settings.custom_price0_text != blank %} {{settings.custom_price0_text }} {% else %} {{ money_price }} {% endif %}
{{ 'products.product.sale_price' | t }} {% if price == 0 and settings.custom_price0_text != blank %} {{settings.custom_price0_text }} {% else %} {{ money_price }} {% endif %} {{ 'products.product.regular_price' | t }} {% if settings.currency_code_enable %} {{ compare_at_price | money_with_currency }} {% else %} {{ compare_at_price | money }} {% endif %}
{{ 'products.product.on_sale' | t }} {{ 'products.product.sold_out' | t }}
{{ 'products.product.unit_price_label' | t }}
{%- capture unit_price_separator -%} /{{ 'general.accessibility.unit_price_separator' | t }}  {%- endcapture -%} {%- capture unit_price_base_unit -%} {%- if variant.unit_price_measurement -%} {%- if variant.unit_price_measurement.reference_value != 1 -%} {{- variant.unit_price_measurement.reference_value -}} {%- endif -%} {{ variant.unit_price_measurement.reference_unit }} {%- endif -%} {%- endcapture -%} {% if settings.currency_code_enable %} {{ variant.unit_price | money_with_currency }} {% else %} {{ variant.unit_price | money }} {% endif %} {{- unit_price_separator -}}{{- unit_price_base_unit -}}
{% else %} {{settings.custom_price0_text }} {% endunless %}