Product Category
The product_category
object has the following attributes:
product_category.products
Returns an array of the product_category’s products. [Optional]
product_category.url
Returns the url of a product_category.
Input
<a href="{{ product_category.url }}">{{ product_category.name }}</a>
Output
<a href="/products/9200-pc-laptops-netbooks">PC Laptops & Netbooks</a>
product_category.current?
Returns true if this product_category is the one which is currently displayed.
Input
<ul class="nav">
{% for product_category in listing.product_categories %}
<li>
<a href="{{ product_category.url }}" {% if product_category.current? %}class="active"{% endif %}>{{ product_category.name }}</a>
</li>
{% endfor %}
</ul>
Output
<ul class="nav">
<li><a href="/products/1-shirt" class="active">Shirt</a></li>
<li><a href="/products/2-shoe">Shoe</a></li>
</ul>