{% 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 %}
{% if settings.display_vendor %} {{ product.vendor }} {% endif %} {% if hover_enabled %} {{ product.title }} {% else %} {{ product.title }} {% endif %} {% if collection_handles contains 'coming-soon' %} {% if settings.stickers_enabled == false %} {{ 'collections.general.coming_soon' | t }} {% endif %} {% else %} {% if product.price_varies and product_price > 0 %} {{ 'products.general.from' | t }} {% endif %} {% if product_price > 0 %} {% render 'price-element', price: product_price %} {% else %} {{ settings.free_price_text }} {% endif %} {%- assign variant = product.selected_or_first_available_variant -%} {% liquid assign variant_price = variant.price assign variant_compare_at_price = variant.compare_at_price if active_discount assign variant_price = variant.metafields.app--168074346497.auto_discounted_price.value | default: variant.price assign variant_compare_at_price = variant.compare_at_price 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 endif if variant_price < variant.price and variant_compare_at_price == 0 or variant_compare_at_price == blank assign variant_compare_at_price = variant.price endif endif %} {% if variant_price < variant_compare_at_price %} {% render 'price-element', price: variant_compare_at_price %} {% endif %} {% if settings.select_first_available_variant %} {%- assign variant_for_unit_price = product.variants | sort: 'price' | first -%} {% render 'unit-price', item: variant_for_unit_price, class: 'product-thumbnail__unit-price' %} {% endif %} {% endif %}