metatroncubeswdev 365e45406a Bundle Offers Shopify app: discount function, admin, storefront, deploy stack
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>
2026-10-13 21:35:58 -04:00

33 lines
1.6 KiB
Plaintext

{% doc %}
Deal summary of a bundle offer (brief §5), translated. Money values are in shop currency; they are marked
with data-bo-money so bundle-offers.js converts them when the customer shops in another currency.
@param {object} offer - An offer from the app's storefront data
@example
{% render 'bo-summary', offer: offer %}
{% enddoc %}
{%- assign dv_cents = offer.dv | times: 100 | round -%}
{%- capture formatted -%}<span data-bo-money="{{ offer.dv }}">{{ dv_cents | money }}</span>{%- endcapture -%}
{%- assign pct = offer.dv | round: 2 -%}
{%- case offer.t -%}
{%- when 'bxgy' -%}
{%- if offer.gp >= 100 -%}
{{- 'bundle_offers.summary.bxgy_free' | t: buy: offer.bq, get: offer.gq -}}
{%- else -%}
{%- assign gp = offer.gp | round: 2 -%}
{{- 'bundle_offers.summary.bxgy_pct' | t: buy: offer.bq, get: offer.gq, pct: gp -}}
{%- endif -%}
{%- when 'mix' -%}
{%- case offer.dt -%}
{%- when 'fixed_price' -%}{{- 'bundle_offers.summary.mix_price_html' | t: n: offer.q, price: formatted -}}
{%- when 'amount' -%}{{- 'bundle_offers.summary.mix_amount_html' | t: n: offer.q, off: formatted -}}
{%- else -%}{{- 'bundle_offers.summary.mix_pct' | t: n: offer.q, pct: pct -}}
{%- endcase -%}
{%- else -%}
{%- case offer.dt -%}
{%- when 'fixed_price' -%}{{- 'bundle_offers.summary.fixed_price_html' | t: price: formatted -}}
{%- when 'amount' -%}{{- 'bundle_offers.summary.fixed_amount_html' | t: off: formatted -}}
{%- else -%}{{- 'bundle_offers.summary.fixed_pct' | t: pct: pct -}}
{%- endcase -%}
{%- endcase -%}