Skip to content

getProductsListSortTypes()

The getProductsListSortTypes method is used to get list of available sort types for products in current location in a storefront.

Returned value

The SortTypesList object.

Example

source
{% set sortTypes = ObjectApi.getProductsListSortTypes() %}

<ul>
{% for sortType in sortTypes %}
    <li>ID:{{ sortType.id }} - {{ sortType.name }}</li>
{% endfor %}
</ul>
output
ID:9 - Product name from A to Z
ID:3 - From the lowest price