diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..e34d975 Binary files /dev/null and b/.DS_Store differ diff --git a/snippets/product-card-badge.liquid b/snippets/product-card-badge.liquid new file mode 100644 index 0000000..e52890c --- /dev/null +++ b/snippets/product-card-badge.liquid @@ -0,0 +1,23 @@ +{%- assign badge_position = settings.badge_position -%} +{% liquid + assign product_card_product_price = product_card_product.price + + assign product_card_product_compare_at_price = product_card_product.compare_at_price + + assign product_card_product_price = product_card_product.metafields.app--168074346497.min_auto_discounted_price.value | default: product_card_product.price + + if product_card_product_price < product_card_product.price and product_card_product_compare_at_price == 0 or product_card_product_compare_at_price == blank + assign product_card_product_compare_at_price = product_card_product.price + endif +%} +{%- unless product_card_product.available -%} +{{ 'products.product.sold_out' | t }} +{%- endunless -%} +{%- if product_card_product_compare_at_price > product_card_product_price and product_card_product.available -%} +{{ 'products.product.on_sale' | t }} +{%- endif -%} +{%- if product_card_product.metafields.theme.preorder and product_card_product.available -%} + + {{ 'products.product.pre_order' | t }} + +{%- endif -%}