{%- comment -%} Auto Discount Display — standalone snippet Use this snippet on themes where Shopify's Theme App Extension injection doesn't run reliably, e.g. page builders like Instant, Replo, Shogun, PageFly, GemPages, or any custom rendering pipeline that bypasses content_for_header. Install: 1. Place this file in your theme's snippets/ folder. 2. Add a single render tag to layout/theme.liquid, near : {% raw %}{% render 'auto-discount-display' %}{% endraw %} 3. Open the Auto Discount Display app and click "Sync discounts" once so the public metafield this snippet reads from is populated. This snippet reads from the public namespace shop.metafields['auto_discount_display']['discount_rules'] (not the $app namespace, which is only readable from within the Theme App Extension). The display logic is inlined below rather than loaded from a CDN URL, so the snippet stays in sync with the deployed app version automatically and does not depend on a versioned asset path. {%- endcomment -%} {%- assign rules_meta = shop.metafields['auto_discount_display']['discount_rules'] -%} {%- if rules_meta and rules_meta.value.enabled -%} {%- assign should_run = false -%} {%- if request.page_type == 'product' -%} {%- assign should_run = true -%} {%- elsif request.page_type == 'collection' or request.page_type == 'index' -%} {%- assign should_run = true -%} {%- endif -%} {%- if should_run -%} {%- endif -%} {%- endif -%}