{% liquid assign active_discount = true assign empty_array = "" | split: "" assign dormant_discounts = shop.metafields.app--168074346497.dormant_discounts.value | default: empty_array assign target_discount_id = product.metafields.app--168074346497.applied_discount_id.value for dormant_discount in dormant_discounts if dormant_discount == target_discount_id assign active_discount = false endif endfor assign product_price = product.price assign product_compare_at_price_max = product.compare_at_price_max assign product_compare_at_price = product.compare_at_price if active_discount assign product_price = product.metafields.app--168074346497.min_auto_discounted_price.value | default: product.price if product_price < product.price and product_compare_at_price == 0 or product_compare_at_price == blank assign product_compare_at_price = product.price endif if product_price < product.price and product_compare_at_price_max == 0 or product_compare_at_price_max == blank assign product_compare_at_price_max = product.price_max endif endif %}