From 39d205f37245306b116db9adb95b4519575e19ec Mon Sep 17 00:00:00 2001 From: alexanderroese Date: Mon, 3 Jun 2024 22:47:08 +0200 Subject: [PATCH] calc discount --- snippets/card-product.liquid | 9 ++++----- snippets/price.liquid | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/snippets/card-product.liquid b/snippets/card-product.liquid index 04a6b45..bcb698b 100644 --- a/snippets/card-product.liquid +++ b/snippets/card-product.liquid @@ -120,16 +120,14 @@ {{- 'products.product.sold_out' | t -}} - {% comment %} - + {%- elsif card_product.compare_at_price > card_product.price and card_product.available -%} {{- 'products.product.on_sale' | t -}} {%- endif -%} - - {% endcomment %} - + + {% comment %} {%- elsif card_product.compare_at_price > card_product.price and card_product.available -%} {%- assign compare_at_price_float = card_product.compare_at_price | divided_by: 1.0 -%} {%- assign price_float = card_product.price | divided_by: 1.0 -%} @@ -140,6 +138,7 @@ {{ discount_percent_rounded }}% Rabatt {%- endif -%} + {% endcomment %} diff --git a/snippets/price.liquid b/snippets/price.liquid index d65a00c..5d6ca6a 100644 --- a/snippets/price.liquid +++ b/snippets/price.liquid @@ -122,7 +122,7 @@ - {{ 'products.product.sold_out' | t }} test + {{ 'products.product.sold_out' | t }} {%- endif -%}