Skip to content

getNewProducts(int items_per_page)

The getNewProducts method is used to get the ProductsList object that represents a list of all products marked as new 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 newProducts = ObjectApi.getNewProducts() %}
{% for product in newProducts %}
    <p>{{ product.name }} - {{ product.producer.name }}</p>
{% endfor %}
output
<p>Logitech Mouse MX2 - Logitech</p>
<p>Dominator G75 - MSI</p>