Attribute combination Loop

Attribute combination loop lists attribute combinations.

{loop type="attribute_combination" name="the-loop-name" [argument="value"], [...]}

Important informations :

* : argument is required
** : at least one of ** marked argument is required

Global arguments

Argument Description
backend_context

Determine if loop is use in backend context.

default : false

example : backend_context="on"

force_return

force return result for i18n tables even if there is no record

default : false

example : force_return="on"

limit

The maximum number of results to display.

example : limit="10"

name *

The loop name. This name must be unique and is used to reference this loop further in the page (see ifloop, elseloop or pageloop)

offset

The first product to display offset. Will not be used if `page` argument is set.

default : 0

example : offset="1"

page

The page to display.

example : page="2"

Loop arguments

Argument Description
lang

A lang id

example : lang="1"

order

A list of values

Expected values :
  • alpha : alphabetical order on attribute title
  • alpha_reverse : reverse alphabetical order on attribute title
  • manual : order by ascending position Thelia >= 2.3
  • manual_reverse : order by descending position Thelia >= 2.3

default : alpha

example : order="alpha_reverse"

product_sale_elements *

A single product sale elements id.

example : product="2"

Global outputs

Variable Description
$LOOP_COUNT the current results index, starting from 1
$LOOP_TOTAL the total number of results returned by the loop
$CREATE_DATE The creation date of this Attribute_combination
$UPDATE_DATE The last modification date of this Attribute_combination

Loop outputs

Variable Description
$ATTRIBUTE_AVAILABILITY_CHAPO the attribute availability chapo
$ATTRIBUTE_AVAILABILITY_DESCRIPTION the attribute availability description
$ATTRIBUTE_AVAILABILITY_ID the attribute availability id
$ATTRIBUTE_AVAILABILITY_POSTSCRIPTUM the attribute availability postscriptum
$ATTRIBUTE_AVAILABILITY_TITLE the attribute availability title
$ATTRIBUTE_CHAPO the attribute chapo
$ATTRIBUTE_DESCRIPTION the attribute description
$ATTRIBUTE_ID the attribute id
$ATTRIBUTE_POSTSCRIPTUM the attribute postscriptum
$ATTRIBUTE_TITLE the attribute title
$LOCALE the locale used for this loop
I want to display all products sale elements for current product and show all the attribute combinations which matched it.
{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}