Skip to main content

Product

Product loop lists products from your shop. You very probably will have to use the product sale elements loop inside your product loop.
{loop type="product" name="the-loop-name" [argument="value"], [...]}

Arguments

ArgumentDescriptionDefaultExample
attribute_non_strict_matchOnly available if complex='true'
promo, new, quantity, weight or price may differ in the different product sale element depending on the different attributes. This parameter allows to provide a list of non-strict attributes.
liste of expected values
noneattribute_non_strict_match="promo,new" :
loop will return the product if it has at least a product sale element in promo and at least a product sale element as new ; even if it's not the same product sale element.
brandA single or a list of brand ids.page="2"
categoryA single or a list of category ids.limit="10"
category_defaultA single or a list of default category ids allowing to retrieve all products having this parameter as default category.0offset="10"
complexA boolean. If set to true, product loop will consider all product sale elements else it will only consider default product sale element. Some of the arguments/outputs will not be available depending on the complex argument.falsecomplex="true"
contentOne or more content ID. When this parameter is set, the loop returns the products related to the specified content IDs.content="3"
currencyA currency idcurrency="1"
currentA boolean value which allows either to exclude current product from results either to match only this productcurrent="yes"
current_categoryA boolean value which allows either to exclude current category products from results either to match only current category products. If a product is in multiple categories whose one is current it will not be excluded if current_category="false" but will be included if current_category="yes"current_category="yes"
depthA positive integer value which precise how many subcategory levels will be browse. Will not be consider if category parameter is not set.1depth="2"
excludeA single or a list of product ids.exclude="2", exclude="1,4,7"
exclude_categoryA single or a list of category ids. If a product is in multiple categories which are not all excluded it will not be excluded.exclude_category="2", exclude_category="1,4,7"
exclude_tax_rule_idFilter products not having this tax rule IDexclude_tax_rule_id=21
feature_availabilityA list of mandatory features and the feature_availability expected for these.feature_availability="1: (1 | 2) , 2:*, 3: 10 | (11&12)" : feature 1 must have feature_availability 1 or 2 AND feature 2 must be set to any feature_availability AND feature 3 must have feature_availability 10 or both feature_availability 11 and 12
feature_valuesA list of mandatory features and the string value expected for these.feature_values="1: (foo | bar) , 2:*, 3: foobar" : feature 1 must have feature value "foo" or "bar" AND feature 2 must be set to any feature_availability AND feature 3 must have feature value "foobar"
idA single or a list of product ids.id="2" or id="1,4,7"
langA lang idlang="1"
max_priceA float value. Equal value matches.max_price="32.1"
max_weightA float value. Equal value matches.max_weight="32.1"
min_priceA float value. Equal value matches.min_price="12.3"
min_stockAn integer value. Equal value matches.min_stock="3"
min_weightA float value. Equal value matches.min_weight="32.1"
newA boolean value to get products by their newnessnew="yes"
orderThe order for sorting products, see sorting possible valuesalphaorder="category,min_price"
promoA boolean value.promo="yes"
refA single or a list of product references.ref="PROD011" or ref="PROD011,PROD018"
return_urlA boolean value which allows the urls generation.yesreturn_url="no"
tax_rule_idFilter products having this tax rule IDtax_rule_id=21
titlefilter by titletitle="foo"
virtualA boolean value.virtual="yes"
visibleA boolean value.yesvisible="no"
with_prev_next_infoA boolean. If set to true, $HAS_PREVIOUS, $HAS_NEXT, $PREVIOUS, and $NEXT output variables are available.falsewith_prev_next_info="yes"

Plus the global arguments and search arguments

Outputs

The product loop has a specific behaviour with the parameter complex if set to true some values will not be handled the same way and some other will not be available.

VariableValueIf complex='true'If complex='false'
$BEST_PRICEthe product best tax-free price for the received arguments, depending on the attributes and promo status.
$BEST_PRICE_TAXthe best price taxes amount
$BEST_TAXED_PRICEthe best price including taxes
$BRAND_IDthe brand id of this product. Empty if no brand is assigned for this product
$CHAPOChapo
$DEFAULT_CATEGORYthe default category id associated to this product
$DESCRIPTIONDescription
$EAN_CODEThe default product sale elements EAN Code🚫
$HAS_NEXTtrue if a product exists after this one in the current category, following products positions. Only available if with_prev_next_info parameter is set to true
$HAS_PREVIOUStrue if a product exists before this one in the current category, following products positions. Only available if with_prev_next_info parameter is set to true
$IDthe product id
$IS_NEWNewnessreturn true if at least one of it's product sale element is newreturn true if the default product sale element is new
$IS_PROMOreturns if at least one of it's product sale element is in promoreturns if the default product sale element is in promo
$IS_TRANSLATEDcheck if the product is translated or not
$LOCALEthe locale used for this loop
$META_DESCRIPTIONthe product meta description
$META_KEYWORDSthe product meta keywords
$META_TITLEthe product meta title
$NEXTThe ID of product after this one in the current category, following products positions, or null if none exists. Only available if with_prev_next_info parameter is set to true
$POSITIONthe product position
$POSTSCRIPTUMPostscriptum
$PREVIOUSThe ID of product before this one in the current category, following products positions, or null if none exists. Only available if with_prev_next_info parameter is set to true
$PRICEthe default product sale elements price🚫
$PRICE_TAXthe default product sale elements price tax🚫
$PRODUCT_SALE_ELEMENTthe default product sale elements id🚫
$PROMO_PRICEthe default product sale elements promo price🚫
$PROMO_PRICE_TAXthe default product sale elements promo price tax🚫
$PSE_COUNTthe number of product sale elements🚫
$QUANTITYthe default product sale elements stock quantity🚫
$REFthe product reference
$TAXED_PRICEthe default product sale elements taxed price🚫
$TAXED_PROMO_PRICEthe default product sale elements taxed promo price🚫
$TAX_RULE_IDthe product's tax rule ID
$TEMPLATEthe template id associated to this product
$TITLETitle
$URLthe product URL
$VIRTUALReturn if the product is a virtual product or not
$VISIBLEReturn if the product is visible or not
$WEIGHTthe default product sale elements weight🚫

Plus the global outputs

Examples

I want to display all products from categories 1 and 2 and their subcategories whose feature color (ID : 1) is blue (ID : 13) or lightblue (ID : 17), order by ascending price

<ul>
{loop type="product" name="my_product_loop" category="1,2" depth="2" feature_availability="1:13|17" order="min_price"}
<li>{$TITLE} ({$REF})</li>
{/loop}
</ul>

I want to display all products which are in promo for the current category displaying the new products first and then order by decreasing price

<ul>
{loop type="product" name="another_product_loop" promo="true" current_category="true" order="new,max_price"}
<li>{$TITLE} ({$REF})</li>
{/loop}
</ul>

Order possible values

Arguments

Ascending valueDescending valueSorted fields
alphaalpha_reverseTitle
createdcreated_reverseCreation date
updatedupdated_reverseLast update date
idid_reverseId
refref_reverseReference
manualmanual_reverseBy position considering a given category, category argument must be set
min_pricemax_pricePrice
positionposition_reverseBy position, without considering a parent category
visiblevisible_reverseVisible
given_idReturn the same order received in id argument which therefore must be set
newNew products first
promoPromo product first
randomRandom order

attribute_non_strict_match possible values

Arguments

Expected valuesdescription
*all the attributes are non strict
max_price
max_weight
min_price
min_stock
min_weight
new
noneproduct loop will look for at least 1 attribute which matches all the loop criteria.
promo