Skip to content

getBestsellingProducts(int items_per_page)

The getBestsellingProducts method is used to get the ProductsList object that represents a list of all products marked as bestseller in the storefront.

Input parameters

items_per_page

int Number of items in a page of internal paginator. Parameter is optional. Default value is 16.

Returned value

The ProductsList object.

Example

source
{% set bestsellingProducts = ObjectApi.getBestsellingProducts() %}
{% for product in bestsellingProducts %}
    <p>{{ product.name }} - {{ product.producer.name }}</p>
{% endfor %}
output
<p>Samsung S10 - Samsung</p>
<p>Corn Flakes 500g - Nestle</p>