Implementing layered navigation in a theme
The Layered Navigation module appeared in PrestaShop 1.4, and provides shop visitors with a quick way to filter products based on specific criteria.
Unfortunately, it only works for themes which make use of it – for instance, older themes have little chance to be able to display it properly. Likewise, your own theme might not yet be able to display it.
Two theme features need to be updated in order to support this navigation style:
- The product quantity in the category, depending on the selected filters.
For instance, "There are X products in the category".
- The category title (h1 tag), in order to avoid duplicated content in search engine, and thus improve SEO.
For instance, when applying the "blue" filter to the "iPod" category, the category will be "iPods - Blue".
All these changes are to be applied to the
First, add the
$categoryNameComplement value after the category name:
Then, remove the part that displays the number of products, and put it in a new
category-count.tpl template file. For instance:
category-count.tpl file contains the lines that were removed from