AJAX Faceted Filters for PrestaShop — Documentation
Install, configure and operate AJAX faceted navigation: facets, price slider, filtered-URL SEO, per-category scoping, cache and statistics.
This guide covers installing, configuring and operating the AJAX Faceted Filters module for PrestaShop 8 and 9. The module replaces the native faceted search with faster AJAX navigation, a price slider with histogram, and fine-grained control over the SEO indexability of filtered pages.
Installation
In your back office, open Modules > Module Manager, click Upload a module and drop the dffacetedfilter.zip file. On installation the module automatically:
- creates its tables and admin tab;
- runs a first facet sync from your catalog;
- warms up the price index (within a few seconds).
The module takes priority on the productSearchProvider hook so it runs ahead of PrestaShop’s native faceted search. No theme file is overridden.
First configuration
Go to Catalog > Faceted filters. There you’ll find the facet list, an overview dashboard and the general and SEO settings.
Sync facets
The Sync facets from catalog button automatically creates the missing facets from your attribute groups, features and built-in facets (price, brand, on-sale, availability, condition). Existing facets are never modified: you can re-run the sync safely after adding an attribute or a feature.
Rebuild the price index
The Rebuild price index button recomputes the price bounds of every product, in batches, with a progress bar. Run it after installation and after any bulk product import.
Managing facets
Each row can be reordered by drag and drop (the order drives both the front-office display order and the normalized URL order), enabled or disabled, and edited.
Facet options
- Label: the displayed name, translatable per language.
- Display: checkboxes, color / texture swatches, or plain links. Color groups automatically inherit the swatch display.
- Multi-select: allows selecting several values of the same facet at once, combined with OR.
- Show counters: shows the product count next to each value.
- Hide empty values: hides zero-product values instead of showing them greyed out.
- Collapsed by default: the facet shows closed and the visitor expands it on click.
- Values before “Show more”: number of values shown before the expand button (0 = show all).
Disjunctive counting is applied: each facet is counted taking every other selection into account, but not its own. Selecting “Red” therefore never zeroes out “Blue” within the same facet.
The price slider and its index
The Price facet appears as a dual range slider. Above it, a product distribution histogram over twelve buckets helps visitors gauge the price range. This data comes from a dedicated price index, separate from PrestaShop’s tables, to stay fast even on a large catalog.
Index maintenance
The index is updated in real time by hooks whenever a product, a specific price or a combination changes. For a scheduled full rebuild, use the cron endpoint shown in the back office:
/module/dffacetedfilter/cron?token=YOUR_TOKEN
The call processes the index in chunks with a time guard of about 20 seconds; if products remain, the response returns the continuation URL to call again. A nightly call is enough in most cases.
The Filter prices tax included setting controls whether the slider reasons on tax-inclusive or tax-excluded prices. The index stores prices in the default currency; the display is converted to the current currency.
The On-sale facet
The On sale facet filters products currently reduced: items flagged “on sale” or covered by an active specific price (a running reduction, within its date range, for the current currency, country and group). It is created enabled by default during the sync.
Availability and condition
Two complementary built-in facets are created disabled, to enable as needed:
- Availability: an “In stock” value that respects your out-of-stock ordering setting.
- Condition: new, used, refurbished.
Restricting a facet to categories
By default a facet appears on every listing page. In the edit form, the Restrict to categories section lets you tick one or more categories: the facet will then appear only on those categories and their subcategories.
This is the right way to keep a relevant filter menu on a heterogeneous catalog: show “Shoe size” only under Shoes, “Screen size” only under Tech. Leave everything unticked for a global facet.
Facet SEO
This is one of the module’s strengths: you decide precisely which filtered pages may be indexed. Filter URLs are readable and follow this format:
/category?dff=color:red,navy/price:10,50/brand:nike
Facets are separated by a slash, a facet slug and its values by a colon, and values by a comma. The facet order and the value sorting are normalized so that a given combination always produces a single canonical URL.
SEO settings
- Indexable (per facet): a non-indexable facet forces the filtered page to
noindex, followand addsrel="nofollow"on its links. - Max. indexable values: beyond this number of selected values, the page switches to
noindex, follow. A value of 1 is the safest against crawl-budget explosion. - Self-canonical on indexable pages: indexable pages get a canonical tag pointing to their own normalized filter URL. The theme canonical is removed on the front end to avoid duplicates.
- Noindex all filtered pages: forces
noindex, followon every filtered page, whatever the per-facet settings.
A filtered page is also set to noindex, follow when a sort parameter is present, since it is a duplicate of the page in its default order.
AJAX modes
The AJAX mode setting determines how the page updates when a filter is clicked:
- Theme (native events) — recommended: the module emits PrestaShop’s native event and lets the core and theme refresh the list, the facets and the browser history. This is the most compatible mode with classic-based themes.
- Self-managed: for non-standard themes, the module fetches the page over AJAX itself and swaps the relevant blocks. Use it only if the Theme mode doesn’t refresh the page correctly.
Counter cache
Computing disjunctive counters can be costly on a large catalog. The module caches their result for a short, configurable time (300 seconds by default). This cache is automatically invalidated on every catalog change and every facet edit. A Clear counter cache button is available in the back office.
Usage statistics
The dashboard at the top of the admin page summarizes the last 30 days: products indexed, number of filtered page views, share of crawl budget kept out of the index (filtered pages served as noindex) and a ranking of the most-used facets. You can disable statistics recording in the performance settings.
Supported pages
Facets apply to category, brand, supplier, new-products, best-sellers, specials and search results pages (respecting PrestaShop’s native ranking). The Brand facet is automatically hidden on a brand page, and category-scoped facets on a search page.
Disabling the native faceted search
The module takes priority over ps_facetedsearch, but we recommend disabling the latter to avoid duplicate indexing work. A back-office warning reminds you if it is still active.
Troubleshooting
- Facets don’t show: run a sync, check that at least one facet is active, and that you are on a supported listing page.
- The price slider is missing: rebuild the price index; the Price facet hides itself while the index is empty for the displayed category.
- The page doesn’t refresh over AJAX: switch the AJAX mode to “Self-managed” if your theme doesn’t follow the PrestaShop standard.
- Too many indexed pages: lower the max. indexable values, make high-cardinality facets (color, size) non-indexable, or enable “Noindex all filtered pages” while you regain control.
The source code is shipped unencrypted. You get 12 months of compatibility updates and support within 24 h.