{%- comment -%} MIT License · (c) 2026 Lintel · https://lintelagency.com/resources/shopify-sections {%- endcomment -%} {%- comment -%} Product tabs: up to 6 tabs of product information. Each tab shows text entered in the block, the product description, a page, or a product metafield. Tabs on desktop (ARIA tablist with arrow keys, Home and End), an accordion on mobile, or an accordion everywhere. Every tab's content is in the HTML; tabs only change which one is shown. Uses the product picked in the settings, or the product of the product template. Tabs whose source is empty for a product (no description, metafield not set) are left out. No snippets needed. {%- endcomment -%} {%- liquid assign s = section.settings assign p = s.product if p == blank assign p = product endif assign heading_tag = s.heading_tag | default: 'h2' assign uid = 'lib-ptabs-' | append: section.id assign list_label = s.heading | strip_html | strip if list_label == blank assign list_label = p.title | default: 'Product details' endif assign tabs_html = '' assign items_html = '' assign n = 0 -%} {%- for block in section.blocks -%} {%- liquid assign b = block.settings assign body = '' -%} {%- capture body -%} {%- case b.source -%} {%- when 'description' -%} {%- if p != blank -%} {{- p.description -}} {%- elsif request.design_mode -%}

The product description appears here. Pick a product in the section settings to preview it.

{%- endif -%} {%- when 'page' -%} {%- if b.page != blank -%} {{- b.page.content -}} {%- elsif request.design_mode -%}

Pick a page in this tab's settings to show its content here.

{%- endif -%} {%- when 'metafield' -%} {%- liquid assign mf = blank assign key_parts = b.metafield | strip | split: '.' if p != blank and key_parts.size == 2 assign mf_namespace = key_parts.first assign mf_key = key_parts.last assign mf = p.metafields[mf_namespace][mf_key] endif -%} {%- if mf != blank -%} {%- case mf.type -%} {%- when 'multi_line_text_field' -%}

{{ mf.value | escape | newline_to_br }}

{%- when 'single_line_text_field' -%}

{{ mf.value | escape }}

{%- else -%} {{- mf | metafield_tag -}} {%- endcase -%} {%- elsif request.design_mode -%}

The metafield {{ b.metafield | escape }} is empty or not set for this product.

{%- endif -%} {%- else -%} {{- b.content -}} {%- endcase -%} {%- endcapture -%} {%- liquid assign body_check = body | strip_html | strip assign has_media = false if body contains '