Themes built on the Twig templating engine are now deprecated and require migration to Vitrin to ensure continued support and compatibility with Zid.
/categories/{category_id}/{slug}category_details| Variable | Type |
|---|---|
category | Category |
products | ProductList |
store | Store |
session | Session |
| Property | Description |
|---|---|
category.id | ID |
category.name | Name |
category.slug | URL slug |
category.description | Description |
category.image | Image |
category.sub_categories | Child categories |
category.parent_category | Parent category |
| Property | Description |
|---|---|
products.results | Product list |
products.count | Total count |
products.page | Current page |
products.pages_count | Total pages |
products.filters | Available filters |
{% extends "layout.jinja" %}
{% block main_content %}
<h1>{{ category.name }}</h1>
{% if category.sub_categories %}
{% for sub in category.sub_categories %}
<a href="{{ url_for('category_details', category_id=sub.id, slug=sub.slug) }}">
{{ sub.name }}
</a>
{% endfor %}
{% endif %}
{% if products.filters | length > 0 %}
{% include 'vitrin:products/filters.jinja' %}
{% endif %}
<div class="products">
{% for product in products.results %}
{% include 'components/product-card.jinja' %}
{% endfor %}
</div>
{% include 'components/pagination.jinja' %}
{% endblock %}