Menu Close

Get Support From ShopWired Close

All systems fully operational

Subscribe To Updates
Prefer To Live Chat? Chat directly with ShopWired support Available from 9.00am to 6.00pm Monday to Friday Quickest response time
Send A Message
Response within 24 hours

Menu Close

Menu

Category

The category object has the following attributes:

category.id

Returns the unique platform ID for the category.


category.title

Returns the title/name of the category.


category.url

Returns the relative URL of the category.

{{ category.url }}

returns...

/nike-airmax-trainers-in-white

category.photo_url

Returns the URL of the photo/image for the category.


category.photo_description

Returns the ALT text for the photo/image for the category.


category.description

Returns the description of the category. Use the raw filter so that the variable is not escaped.

If enabled, the {{ category.description2 }} variable will return the 2nd category description.


category.from_price

Returns the from price for the category (i.e. calculates the cheapest price for the product within the category and returns it).


category.current

Returns true if the category is the current category (this can be used in sidebar menus to highlight the selected category).


category.open

Returns true if the category is open in the category menu.


category.categories

Returns an array of the categories (subcategories) within the category.

{% for category in categories %}
    {{ category.title }}
{% endfor %}

returns...

Dresses
Coats
Shoes

Note: Only the category's immediate subcategories are returned in the array.


category.parents

Returns an array of the categories assigned to the category as parents.

{% for parent in category.parents %}
    {{ parent.title }}
{% endfor %}

category.all_products_count

For a parent category, will return the total number of products that the ?all=1 function will return.


category.active

Returns true if the category is active, and false if the category is not active.