Kartris User Guide

4.3. Sort order of products and categories

You have a number of tools to control the order in which products and categories are listed on the site. There are broad global settings which you can use to apply sort rules across the site, but you can also have granular control right down to individual items and put them in exactly the order you wish.

4.3.1. Default sort order

Typically as default, categories, products and versions will be sorted based on three corresponding config settings:

frontend.categories.display.sortdefault
frontend.products.display.sortdefault
frontend.versions.display.sortdefault


The sort direction (ascending or descending) is determined by these config settings:

frontend.categories.display.sortdirection
frontend.products.display.sortdirection
frontend.versions.display.sortdirection


These are the 'global' settings. When you create new categories and products, they will default to using these config settings for sorting the child categories, products and versions under them.

4.3.2. Changing the sort order of products

The sort criteria for items is set at the parent. If you want certain products to show in a particular order, you must set this at the parent category of those products. First you set the criteria by which products will be sorted:

Sort Products By :

 

  • Product ID
  • Product Name
  • Product Creation Date
  • Product Last Modified Date
  • Product Category Sort

The last one of these should be selected if you wish to manually sort the products into exactly the order you required.

You also need to set a sort direction:

 

  • Ascending
  • Descending

For example, sorting by 'Product Last Modified Date' and sort direction 'Descending' will show the most recently edited/added products first.

To manually sort the products, you must first set the category to sort products by 'Product Category Sort'. You will then see up/down arrows appear on the products when viewed in the back end, as shown below. You can click these to sort the items.

Alternatively, from v2.9014 onwards, you can also drag and drop sort too.

If sorting products manually ("Product Category Sort"), make sure you select the direction as 'ascending'. It won't work correctly if set to 'descending' as the code that tries to find the item above or below to swap with will find the wrong value.

4.3.3. Changing the sort order of categories

The sorting of categories is conducted in a similar way to sorting products; subcategories sorting criteria is controlled from the parent category.

Top level categories are always manually sorted. You can click the 'view categories' toolbar button and then change the sort order of categories with the up/down buttons to the left hand side of each category.

 

Alternatively, from v2.9014 onwards, you can also drag and drop sort too.

 
powered by tomehost