get_collection_pagination
Gets a paginated list of collections to which a product belongs.
To be used in conjunction with the product object.
product | get_collection_pagination(pageSize, page=page) returns a paginate object.
Required Params
-
productproduct: The product object. -
pageSizeinteger: The number of resources per page, with a valid range from 1 to 100.
Optional Params
page integer: The specified page number. If not provided, the page_num parameter in the request URL is used. If neither value is specified, page 1 is used.
Example
The following example is used to get the list of collections that a product belongs to.
{{#var paginate = product | get_collection_pagination(10, page=1) /}}
{{#for item in paginate.list}}
{{forloop.index}}: {{ item.title }}
{{/for}}
Was this article helpful to you?