Rust discount function (one automatic discount evaluating all offers in priority order, parity with the Odoo engine), React Router admin with Polaris, theme app extension and app proxy pages, webhooks incl. GDPR, managed-pricing limits, and a Docker Compose stack (Postgres + Caddy HTTPS) for a single VPS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
40 lines
1.9 KiB
Plaintext
40 lines
1.9 KiB
Plaintext
{%- comment -%} F15: "Festival offers / Bundle & save" strip, up to 8 offers with Homepage on. Place it right after the hero. {%- endcomment -%}
|
|
{%- assign data = app.metafields.bundle_offers.storefront.value -%}
|
|
{%- assign country = localization.country.iso_code -%}
|
|
{%- capture cards -%}
|
|
{%- assign n = 0 -%}
|
|
{%- for offer in data.offers -%}
|
|
{%- if n >= 8 -%}{%- break -%}{%- endif -%}
|
|
{%- if offer.f[0] != 1 -%}{%- continue -%}{%- endif -%}
|
|
{%- if offer.cc.size > 0 -%}{%- unless offer.cc contains country -%}{%- continue -%}{%- endunless -%}{%- endif -%}
|
|
{%- assign n = n | plus: 1 -%}
|
|
<li class="bo-strip__item">{% render 'bo-card', offer: offer %}</li>
|
|
{%- endfor -%}
|
|
{%- endcapture -%}
|
|
{%- if cards != blank -%}
|
|
<section class="bo-section bo-strip" aria-labelledby="bo-strip-{{ block.id }}" {{ block.shopify_attributes }}>
|
|
<div class="bo-strip__head">
|
|
<div>
|
|
{%- assign heading = block.settings.heading -%}
|
|
{%- if heading == blank -%}{%- assign heading = 'bundle_offers.strip.heading' | t -%}{%- endif -%}
|
|
<h2 class="bo-section__title" id="bo-strip-{{ block.id }}">{{ heading }}</h2>
|
|
{%- if block.settings.subheading != blank -%}<p class="bo-section__sub">{{ block.settings.subheading }}</p>{%- endif -%}
|
|
</div>
|
|
<a class="bo-link" href="{{ block.settings.all_url | default: '/apps/bundles' }}">{{ 'bundle_offers.strip.view_all' | t }}</a>
|
|
</div>
|
|
<ul class="bo-strip__track" role="list">{{ cards }}</ul>
|
|
</section>
|
|
{%- endif -%}
|
|
|
|
{% schema %}
|
|
{
|
|
"name": "Bundle offers strip",
|
|
"target": "section",
|
|
"settings": [
|
|
{ "type": "text", "id": "heading", "label": "Heading", "default": "Festival offers" },
|
|
{ "type": "text", "id": "subheading", "label": "Subheading", "default": "Bundle & save" },
|
|
{ "type": "url", "id": "all_url", "label": "\"View all\" link (default: /apps/bundles)" }
|
|
]
|
|
}
|
|
{% endschema %}
|