{% 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 -%}{{ dv_cents | money }}{%- 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 -%}