Product Filter Module
page last edited on 29 January 2018
Let’s imagine that you run an online store that has tons of different products. Each product has its own set of attributes like size, color, material, technical characteristics, and many others that make it distinct from other products. Buyers decisions directly depend on these product attributes and you as a seller can make a buyers choice easier using the product filters module. The filter based on product attributes will help your customers to narrow down the search results and find out the exact products they need. Filter-based search can also include tags, price range, and in-stock availability. You can add a filter-based search block on a category page in the store front-end using the Product Filter module.
The Product Filter module is included into X-Cart Business package and higher and comes pre-installed. However, if it is not you can always enable it yourself as described in Installing and activating addons.
When enabled, you’ll need to open the Settings page and configure the module according to your business needs.
The module settings are as follows:
Enable “In stock only” filter - if enabled the ‘In stock’ selector will be added to the filter
Enable “Price range” filter - if enabled the filter will allow choosing the search price range
Enable “Attributes” filter - if enabled the filter will display the choice of attributes available for the products
For the “Attributes” filter to be displayed you should have attributes set up in your store. For more info on the attributes configuration please refer to Product classes and attributes.
- Enable “Tags” filter - if enabled the filter will show the tags available for search
For the “Tags” filter to be displayed you should have tags set up in your store.
- Show only available attributes and tags for products in category - if enabled X-Cart generates data cache that is used to display in the filter only the attribute values and tags that are actually used for the products in the category being viewed.
Enabling this option will make a page load faster as only a set of particular attributes and tags will be counted, but not all attributes and tags available in your store. This is essential for the stores with a high inventory turnover ratio.
- Cache reset mode - can be set either to generate cache on the fly or to remove cache when attribute, tag or product data is changed. The first option will allow working with the actual inventory stock but will slow down the page loading as it will be necessary to cache filters each time. If you don’t update inventory too often, use the second option.
If the “Remove cache when …” option is chosen a category page cache will be removed and generated anew the first time this page is opened after you change products, categories or attributes data. The first page loading may last more than usual as time will be spent on cache regeneration.
- Sort order for class attributes (available only if the “Attributes” filter is enabled) - here you can choose if the attributes are sorted alphabetically or manually.
This setting affects only the attributes themselves, not their values. The values are sorted alphabetically.
- Generate the URL query string for filter with - can be set to GET params or hash depending on how you prefer the search URL to be assembled.
If you change any setting value don’t forget to Submit the changes.
To define what attributes will be included into the product filter block on a category page in the store front-end open a category page in the admin back-end (Catalog > Categories > Category_Name).
Find the Classes for product filter setting in the Category Info tab.
Here you can choose what classes of attributes will be used to filter products in this category. Available options are as follows:
- All classes from this category - the filter will show classes of all products from this category (the more classes and products a category has the more time it will take to load a category page).
- Do not show the filter - this filter will not be displayed on the category page
- Choose classes - if you use this option you’ll be able to define the exact class(es) the filter will be based on. Using this option you can limit the number of classes applied. You can choose any class from all classes available in your store.
If there are no products in the category itself the product filter won’t be displayed on the category page in the store front-end. If there are subcategories and products belong to a subcategory, but not to the category itself, the Classes for product filter setting should be configured on a subcategory page in the admin back-end.
Once enabled and set up the product filter will become available on the category’s page in the store front-end.
You can change the Product Filter block position in the store front-end using the Webmaster mode.
Help make this document better
This guide, as well as the rest of our docs, are open-source and available on GitHub.