Skip to main content

Accessory

The accessory loop lists products accessories. As an accessory is itself a product, this loop behaves like a product loop. Therefore you can use all product loop arguments and outputs.
{loop type="accessory" name="the-loop-name" [argument="value"], [...]}

Arguments

ArgumentDescriptionDefaultExample
all product loop argumentsorder="min_price", max_price="100"
orderA list of values
Expected values
accessoryorder="accessory,max_price"
product *A single product id.product="2"

Outputs

VariableValue
$ACCESSORY_IDThe product ID of the accessory
$IDthe accessory id
all product loop outputs, except ID, which is the accessory ID

Examples

I want to display all accessories which are in category 1, order by ascending price, for all products in category 2.

<ul>
{loop type="product" name="products_in_category_2" category="2"}
{loop type="accessory" name="accessories_in_category_1_order_by_min_price" category="1" product="$ID" order="min_price"}
<li>{$TITLE} ({$REF})</li>
{/loop}
{/loop}
</ul>

Order possible values

Arguments

Ascending valueDescending valueSorted fields
accessoryaccessory_reverseaccessory
all product loop orders