Skip to main content

Category

Category loop lists categories from your shop.
{loop type="category" name="the-loop-name" [argument="value"], [...]}

Arguments

ArgumentDescriptionDefaultExample
contentOne or more content ID. When this parameter is set, the loop returns the categories related to the specified content IDs.content="3"
currentA boolean value which allows either to exclude current category from results either to match only this categorycurrent="yes"
excludeA single or a list of category ids.exclude="2", exclude="1,4,7"
exclude_parentA single or list of categories id to exclude.exclude_parent="12,22"
exclude_productA single or list product id to exclude.exclude_product="3"
idA single or a list of category ids.id="2", id="1,4,7"
need_count_childA boolean. If set to true, count how many subcategories contains the current categoryfalseneed_count_child="yes"
need_product_countA boolean. If set to true, count how many products contains the current categoryfalseneed_product_count="yes"
not_empty(not implemented yet) A boolean value. If true, only the categories which contains at least a visible product (either directly or through a subcategory) are returnednonot_empty="yes"
orderA list of values
Expected values
manualorder="random"
parentA single or a list of category ids.parent="3", parent="2,5,8"
productA single or list of product IDs.product="3"
ProductCountVisibleOnlyA boolean that specifies whether product counting should be performed only for visible productsfalseProductCountVisibleOnly=true
TemplateIdIDs of template models used to filter categories
visibleA boolean value.yesvisible="no"
with_prev_next_infoA boolean. If set to true, $PREVIOUS and $NEXT output arguments are available.falsewith_prev_next_info="yes"

Plus the global arguments and search arguments

Outputs

VariableValue
$CHAPOThe category chapo
$CHILD_COUNTNumber of subcategories contained by the current category.
Only available if "need_count_child" is set to true
$DESCRIPTIONThe category description
$HAS_NEXTTrue if a category exists after this one in the current parent category, following categories positions.
Only available if "with_prev_next_info" is set to true
$HAS_PREVIOUSTrue if a category exists before this one in the current parent category, following categories positions.
Only available if "with_prev_next_info" is set to true
$IDThe category id
$IS_TRANSLATEDCheck if the category is translated or not
$LOCALEThe locale used for this loop
$META_DESCRIPTIONThe category meta description
$META_KEYWORDThe category meta keyword
$META_TITLEThe category meta title
$NEXTThe ID of category after this one in the current parent category, following categories positions, or null if none exists.
Only available if "with_prev_next_info" is set to true
$PARENTThe parent category
$POSITIONThe category position
$POSTSCRIPTUMThe category postscriptum
$PRODUCT_COUNTNumber of visible products contained by the current category.
Only available if "need_product_child" is set to true
$PREVIOUSThe ID of category before this one in the current parent category, following categories positions, or null if none exists.
Only available if "with_prev_next_info" is set to true
$ROOTID of the root category to which a category belongs
$TEMPLATEThe template id associated to this category
$TITLEThe category title
$URLThe category URL
$VISIBLEReturn if the category is visible or not

Plus the global outputs

Order possible values

Arguments

Ascending valueDescending valueSorted fields
alphaalpha_reversetitle
createdcreated_reversedate of content creation
idid_reverseOrder ID
manualmanual_reverseposition
random
updatedupdated_reversedate of content update
visiblevisible_reverseonline items