Allow your shoppers to choose how many products are displayed on a page

Shoppers can choose how many products are displayed on a product listing page.

To activate this feature you need to go to the WSM and under ‘Settings’ look for the word ‘matches’. Two options will appear. Using the option Display a dropdown that allows shoppers to change number of matches per page you can select the numbers you want to appear in the dropdown – you can insert as many values as you like.

The option Change number of matches per page specifies the default value for the dropdown.

Once a shopper has chosen their preferred value, it is retained until they change it again, or the session has timed out.

To include the drop-down directly you need to add this NitroScript variable:

{ns:includeDropdownItemsPerPage}

If you prefer to create your own drop-down you can use these nitroscript variables:

  • {numberitemspage} Array that contains all the possible dropdown numbers. You need to use a {foreach} to iterate over it.
  • {ns:ItemPerPageShopper} This will contain shopper’s choice.
  • {ns:DefaultMatchesPerPage} Default value chosen in the WSM under the option ‘Change number of matches per page’

Example:

{if (pageproperty['pageid'] ne 'search')}
  <span id="productsperpage">Show: {ns:includeDropdownItemsPerPage}</span>
{endif}
3 Likes