The Filters module narrows a product listing by category, price, rating, brand, tag and whether a product is on sale. A category counts and lists the products in it as their main category and as one of their additional categories, and offers only categories the shopper may open. A tag is offered, and narrows the listing, only while it is published and in a view level the shopper holds. On top of those, you can give shoppers the filters your catalogue is really about — Colour and Size for clothing, Material for furniture, Connectivity for headphones — built from your products’ options and from list, radio and checkboxes custom fields.
Declaring a filter
Filters are declared, not discovered: a filter only appears when you add it under Catalog → Filters. That keeps one-off options such as “Engraving” off the panel, and it is what lets you fold different spellings into one filter.
- Go to Catalog → Filters and click New.
- Enter a Title, such as Colour. It heads the filter in the panel. A language key is translated, so one filter can read in every language of a multilingual store.
- Under Product options, pick the option names this filter reads. The list suggests the names your products use, each with every spelling it covers and how many products carry it — for example colour — Colour, COLOUR · 34 products. Add color too if some products say Color, and type a name no product uses yet if you are about to add it.
- Under Custom fields, pick any list, radio or checkboxes fields of products the filter should also read (optional).
- Choose the Value order and save.
The order of the list under Catalog → Filters is the order of the filters in the panel; drag the rows to change it. Each filter sits after Category in the panel. Unpublish a filter to take it off the storefront without losing it.
How option names are matched
Option names and values are typed per product, so the same thing drifts: Colour, colour, Colour:. Solidshop compares names and values ignoring case, spaces and punctuation, so those three are one name and Navy, NAVY and navy are one value. Accents are kept: Đỏ and Đó stay two values. A different word is a different name — Color and Colour — which is why a filter can read several.
Two side effects to know about: XL+ reads as XL, because the plus is punctuation; and Navy and Navy blue are two values, because they are different words. The Values tab of a filter lists every value it gathers today, the other spellings merged under each, and where each comes from — the place to spot and fix such drift in your products.
Value order
- Natural (the default) puts letter sizes in garment order (XXS, XS, S, S/M, M, L, XL, XXL, 3XL), then values that start with a number by that number (39, 40, 41.5), then everything else from A to Z. Units are not understood: 1TB still comes before 512GB.
- Most products first puts the commonest values on top.
How matching works
Values within one filter are alternatives (Navy or Black); different filters must all hold (Navy and M). For filters on options, Solidshop goes one step further than most carts:
- One variant. Navy and M must be the same variant. A T-shirt sold in Navy/S and Black/M is not a Navy M T-shirt, and it does not show under Navy + M.
- In stock. That variant must be one the shopper can buy: stock above zero, or stock not tracked. If the Navy M is sold out, the T-shirt does not show under Navy + M — but it still shows under Navy alone, and under M alone, as long as another Navy or M variant is in stock.
- Products without variants are their own single unit: their options and their own stock decide.
- Custom fields describe the whole product, so a field filter never looks at stock — like category and brand. A filter that reads both an option and a field (a Colour filter fed by T-shirt options and by a mug’s Colour field) is satisfied by either.
Every number in the panel follows the same rules: the count next to a value is the number of products the listing shows once you tick that value.
The In stock toggle
The panel also offers an In stock toggle that keeps only products a shopper can buy now. It only appears when it would leave something out: while every listed product is in stock, there is nothing for it to do. Switch it off with the module’s Show In-Stock Filter option.
Using a custom field
A field can feed a filter when it is a list, radio or checkboxes field of products, it is published, and its access is Public. A filter is something every shopper sees and links to, so a field you restricted to some visitors cannot be one; the filter form refuses it, and the Catalog → Filters list names any filter whose field has since been unpublished, restricted or deleted. Free-text fields cannot be filters: there is no fixed list of values to offer.
A checkboxes field (or a list that allows several values) puts a product under every value it carries. The panel shows the field’s own option texts, translated when they are language keys.
The Filters module
Your filters appear in the Filters module as soon as they are published — there is nothing to pick per module. A filter with no value on the current listing stays out of the panel, so a Screen size filter does not show on a clothing category. Switch them all off with the module’s Show Option and Field Filters option. A filter with more than ten values gets a search box, like the brand list, and the panel lists up to a hundred values per filter, the most common ones.
URLs and search engines
A filter travels in the URL as filter_ plus its alias, with the values
separated by commas — ?filter_colour=black,navy&filter_size=m.
The values in the URL never depend on the language the shopper reads, so a link works
in every language. A value that no longer exists (an old link to a colour you renamed)
is ignored, and the page shows the listing without it. Changing a filter’s alias
changes its URLs.
Filtered listings carry noindex, follow, like every filter state except a
listing narrowed to one category or one brand: search engines follow their links to
your products, but the countless combinations stay out of search results.
The filter index
To answer filters quickly, Solidshop keeps an index of the values each product carries. It is kept up to date for you: saving a product, deleting a variant or a product, moving products to another category with Batch, and saving, publishing or deleting a custom field all update it. Stock is never part of the index — it is read live — so selling out a size changes the filters at once.
Which values a listing’s filters offer is cached, because on a large catalogue working it out costs more than the rest of the page. Every change above clears the cache, and so do publishing, unpublishing or trashing a product and changing a product category. A product whose publish date arrives brings its values to the filters within 15 minutes. The counts beside the values are never cached.
Rebuild the whole index with Rebuild index on the Catalog → Filters toolbar after:
- moving a product category under another parent — a category’s place in the tree decides which custom fields its products carry;
- restoring a database backup, or writing products into the database by other means than Solidshop.
When the list shows products are not in the filter index yet — after installing or updating Solidshop on a large catalogue, for example — click Finish building. On a very large catalogue, the command line has no time limit:
php cli/joomla.php solidshop:filters:rebuild
php cli/joomla.php solidshop:filters:rebuild --product=42
A product that cannot be indexed is still saved; it just drops out of the index until
the next rebuild. The reason is written to com_solidshop.filters.php in
your site’s log folder (System → Global Configuration →
System → Path to Log Folder).