Purpose#
The ProductAttributes reusable renders a two-column (label/value) list of product attribute items (e.g. Material, Gender, Washing instructions).Where it's rendered#
This reusable is rendered by parent templates/components that pass an attributes array, typically from product-related views.(Example pattern used across the theme){% render 'Reusables\\ProductAttributes\\Default', attributes: product.attributes %}
The reusable expects attributes to be an array of attribute items.Template behavior (Liquid + Alpine)#
The template renders a <ul> list and iterates attributes.
Each attribute item is rendered only if item.attributeItemValue is truthy.
For each rendered item it outputs a responsive grid:right column: item.attributeItemValue
It applies alternating zebra background styles based on index parity (forloop.index0 | modulo: 2).
There is no Alpine wiring in this reusable (no x-data, no $store usage).Data contract (JS runtime)#
This reusable is Liquid-only, but it has a strict runtime data contract for each attribute item.Model shape (storefront example)#
Example (from a real ProductAttributes model dump) keeping only the relevant fields for this reusable:{
"attributes": [
{
"name": "Sample text",
"slug": "sample",
"usedAsFilter": false,
"displayOnProduct": true,
"displayOnList": true,
"displayOnCompare": true,
"attributeId": "Attribute Id",
"attributeItemId": "Attribute Item Id",
"attributeItemValue": "Sample text"
},
...
]
}
attributes[] item fields (as consumed by Liquid)#
Required for meaningful rendering:Rendered as the label (left column).
Rendered as the value (right column). Also acts as a guard: if falsy, the item is not rendered.
Optional fields (present in real data but not used by the current template):JavaScript#
Global object#
Global object: productattributesreusabledefaultIt is currently an empty object ({}) and is not referenced by the Liquid template.
Dependencies#
Liquid: Reusables/ProductAttributes/Default.liquid
Notes#
If attributeItemValue contains long strings, the layout will wrap inside the right column.
This reusable does not currently use translations (Default.json is effectively empty).
Modified at 2026-04-14 13:18:56