Files
season/snippets/line-purchase-type.liquid

19 lines
1.2 KiB
Plaintext

{% doc %}
Compact inline tag shown only on subscription lines: "Suscripción · cada 1 mes".
Rendered inline (inside the price line) so it never adds height to the row.
Full plan name in the title/aria label. One-time purchases get no tag.
@param {object} item - Cart line item
@example
{% render 'line-purchase-type', item: item %}
{% enddoc %}
{%- if item.selling_plan_allocation -%}
{%- assign plan_name = item.selling_plan_allocation.selling_plan.name -%}
{%- assign plan_short = plan_name | split: '(' | first | strip | remove: 'Entrega ' | remove: 'entrega ' -%}
<span class="line-purchase line-purchase--sub" title="{{ plan_name | escape }}" aria-label="{{ 'cart_drawer.subscription' | t }}: {{ plan_name | escape }}">
<svg width="10" height="10" viewBox="0 0 12 12" aria-hidden="true" focusable="false"><path d="M10 4.5A4.2 4.2 0 0 0 2.4 3.4M2 7.5a4.2 4.2 0 0 0 7.6 1.1M2.2 1.5v2.2h2.2M9.8 10.5V8.3H7.6" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/></svg>
<span aria-hidden="true">{{ 'cart_drawer.subscription' | t }}<span class="line-purchase__detail"> · {{ plan_short | escape }}</span></span>
</span>
{%- endif -%}