Skip to main content

Attribute combination

Attribute combination loop lists attribute combinations.
{loop type="attribute_combination" name="the-loop-name" [argument="value"], [...]}

Arguments

ArgumentDescriptionDefaultExample
langA lang idlang="1"
orderA list of values
Expected values
alphaorder="alpha_reverse"
product_sale_elements *A single product sale elements id.product="2"

Outputs

VariableValue
$ATTRIBUTE_AVAILABILITY_CHAPOthe attribute availability chapo
$ATTRIBUTE_AVAILABILITY_DESCRIPTIONthe attribute availability description
$ATTRIBUTE_AVAILABILITY_IDthe attribute availability id
$ATTRIBUTE_AVAILABILITY_POSTSCRIPTUMthe attribute availability postscriptum
$ATTRIBUTE_AVAILABILITY_TITLEthe attribute availability title
$ATTRIBUTE_CHAPOthe attribute chapo
$ATTRIBUTE_DESCRIPTIONthe attribute description
$ATTRIBUTE_IDthe attribute id
$ATTRIBUTE_POSTSCRIPTUMthe attribute postscriptum
$ATTRIBUTE_TITLEthe attribute title
$LOCALEthe locale used for this loop

Examples

I want to display all products sale elements for current product and show all the attribute combinations which matched it.

<ul>
{loop name="pse" type="product_sale_elements" product="$PRODUCT_ID"}
<div>
{loop name="combi" type="attribute_combination" product_sale_elements="$ID"}
{$ATTRIBUTE_ID}. {$ATTRIBUTE_TITLE} = {$ATTRIBUTE_AVAILABILITY_ID}. {$ATTRIBUTE_AVAILABILITY_TITLE}<br />
{/loop}
<br />{$WEIGHT} g
<br /><strong>{if $IS_PROMO == 1} {$PROMO_PRICE} € (instead of {$PRICE}) {else} {$PRICE}{/if}</strong>
<br /><br />
Add
<select>
{for $will=1 to $QUANTITY}
<option>{$will}</option>
{/for}
</select>
to my cart
</div>
{/loop}
</ul>

Order possible values

Arguments

Ascending valueDescending valueSorted fields
alphaalpha_reversetitle
manualmanual_reverseorder by position