Follow

Category List

Variable Usage Explanation
id (int) {% for category in categories %}
{{ category.id }}
{% endfor %}
Returns the ID of the category.
title (str) {% for category in categories %}
<a href="/product/list/categoryId/{{category.id}}">{{category.title}}</a>
{% endfor %}
Returns the title of the category.
level (int) {% for category in categories %}
{{ category.level }}
{% endfor %}
Returns the level of the category.
image (str) {% for category in categories %}
{{ category.image }}
{% endfor %}
Returns the image of the category.
imagePath(str) {% for category in categories %}
<img src="{{ category.imagePath }}" border="0" alt="{{ category.title}}">
{% endfor %}
Returns the image path value of the category image.
children(array) {% for category in categories %}
{% for child in category.children%}
<li>
<a href="/product/list/categoryId/{{child.id}}">{{child.title}}</a>
</li>
{% endfor %}
{% endfor %}
Returns all of the subcategories. Just like in the example (child.title) you can use all variables for this code that we mentioned above. (ex. child.id, child.level, child.image, child.imagepath)

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk