diff --git a/product-card.liquid b/product-card.liquid index 0d93063..c0a2dad 100644 --- a/product-card.liquid +++ b/product-card.liquid @@ -122,21 +122,31 @@ Supported variables {%- endif -%} {%- if show_prices and product.template_suffix != 'quote' -%} -
- {% assign v = product.selected_or_first_available_variant %} - {% assign variant_price = product.selected_or_first_available_variant.price %} - {% if v.metafields.app--168074346497.discount_type.value != nil and v.metafields.app--168074346497.discount_type.value != "fixed" and product.metafields.app--168074346497.discount_percentage.value > 0.01 %} - {% assign deducted_percentage = 1.0 | minus: product.metafields.app--168074346497.discount_percentage.value %} + {% assign v = product.selected_or_first_available_variant %} + {% assign variant_price = v.price %} + {% assign variant_compare_at_price = v.compare_at_price %} + {% if v.metafields.app--168074346497.discount_type.value != nil and v.metafields.app--168074346497.discount_type.value != "fixed" and product.metafields.app--168074346497.discount_percentage.value > 0.01 %} + {% assign deducted_percentage = 1.0 | minus: product.metafields.app--168074346497.discount_percentage.value %} - {% if v.metafields.app--168074346497.discount_percentage.value > 0.01 %} - {% assign deducted_percentage = 1.0 | minus: v.metafields.app--168074346497.discount_percentage.value %} - {% endif %} - - {% assign variant_price = v.price | divided_by: 100.0 | times: deducted_percentage | times: 100.0 | ceil %} + {% if v.metafields.app--168074346497.discount_percentage.value > 0.01 %} + {% assign deducted_percentage = 1.0 | minus: v.metafields.app--168074346497.discount_percentage.value %} {% endif %} + {% assign variant_price = v.price | divided_by: 100.0 | times: deducted_percentage | times: 100.0 | ceil %} + {% assign variant_compare_at_price = v.price %} + {% if v.compare_at_price > variant_compare_at_price %} + {% assign variant_compare_at_price = v.compare_at_price %} + {% endif %} + {% endif %} +
{{ variant_price | money }}
+ + {% if variant_compare_at_price %} + + {{ variant_compare_at_price | money }} + + {% endif %} {%- endif -%}
@@ -305,4 +315,3 @@ Supported variables } }); -