{% liquid assign variant_price = variant.metafields.app--168074346497.auto_discounted_price.value | default: variant.price assign variant_compare_at_price = variant.compare_at_price if variant.metafields.app--168074346497.discount_type.value != nil and variant.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 variant.metafields.app--168074346497.discount_percentage.value > 0.01 assign deducted_percentage = 1.0 | minus: variant.metafields.app--168074346497.discount_percentage.value endif assign variant_price = variant.price | divided_by: 100.0 | times: deducted_percentage | times: 100.0 | ceil assign variant_compare_at_price = variant.price if variant.compare_at_price > compare_at_price assign variant_compare_at_price = variant.compare_at_price endif endif if shop.metafields.app--168074346497.discount_percentage.value > 0.005 assign discount_percentage = shop.metafields.app--168074346497.discount_percentage.value | times: 1.0 assign deducted_percentage = 1.0 | minus: discount_percentage assign variant_price = variant.price | divided_by: 100.0 | times: deducted_percentage | times: 100.0 | ceil assign variant_compare_at_price = variant.price if variant.compare_at_price > compare_at_price assign variant_compare_at_price = variant.compare_at_price endif endif if variant_price < variant.price and variant_compare_at_price == blank assign variant_compare_at_price = variant.price endif %}