Connect the HUSKY filter to a WooCommerce product table
The filter built into a products table covers the basics: price, SKU, stock, categories and attributes. When shoppers need filters that depend on each other, options limited to what is actually available, or a link to the filtered result, connect a WooCommerce product table to the HUSKY filter (WooCommerce Products Filter, also known as WOOF). The table then shows exactly the products HUSKY finds, with its own columns, sorting and pagination. Below is how the connection works, the two shortcodes it takes, and how to get dependent filters and shareable filter URLs out of it.
What the built-in table filter does not do
The Filter tab of a table builds a quick AJAX filter, and for many tables it is enough. It has deliberate limits:
- No dependent options. Each element lists every non-empty term of its taxonomy across the whole shop. Choosing Product A in one drop-down does not reduce the sizes offered in the next one.
- No counts, no hiding of dead ends. A shopper can pick a combination that returns nothing, and only learns it from the empty table.
- No filter state in the URL. The filter works inside the page, so a filtered view cannot be bookmarked or sent to someone.
- Simple controls. Long term names in a narrow multi-select get cut off, and there are no colour swatches, images or step-by-step forms.
HUSKY does all of this. It is a separate plugin from the same team, available on wordpress.org, and the table has a ready connection for it.
Connect the HUSKY filter to a WooCommerce product table
When a table has filter_provider='woof', every request for its rows passes the current HUSKY parameters to HUSKY, HUSKY calculates the IDs of the matching products, and the table shows only those products, still using its own columns, sorting and pagination. The connection lives in the table plugin, so nothing has to be added to functions.php; the code on the woot_filter_provider_ page is the same mechanism, for reference.
- Install and activate HUSKY. In WooCommerce → Settings → Products Filter, on the Structure tab, enable the taxonomies and elements the filter should have (categories, attributes, price and so on) and save.
- Put the filter and the table on the same page:
Replace[woof ajax_redraw=1 autosubmit=1 redirect="https://example.com/price-list/"] [woot id=1 filter_provider='woof']1with the ID of your table and the address with the address of this same page. Theredirectattribute matters: on a regular page (anything but a product category, tag or attribute archive) HUSKY builds its search links on the shop page, so without it a search can send the shopper to the shop, where the table is not. The filter can also go into a sidebar widget of that page; the HUSKY widget has the same settings as Redirect to and Form AJAX redrawing. - Check the quotes. Type the shortcodes in a code editor or a Shortcode block. Word processors and some editors turn
'woof'into’woof’with typographic quotes; the attribute value then no longer equalswoof, and the table ignores the filter without any error. You can also drop the quotes:filter_provider=woofworks. - Switch off the table's own filter and search. With
filter_provider='woof'the table hands the filtering to HUSKY, and most elements of its own Filter tab, as well as its search by title field, stop narrowing the results. Leave the Filter tab empty or switch on Disable filter form in the table's Options, switch off Show search by title there, and use the HUSKY text search instead, as described in searching a product table by description.
With or without page reloads
The ajax_redraw=1 attribute decides how the page reacts to a filter change.
[woof ajax_redraw=1 autosubmit=1]: no reload. On every change HUSKY redraws only its form, with updated counts, and announces it with a JavaScript event; the table listens to that event and reloads its rows with the new filter. After the first change the table hides the HUSKY Filter button, since the table updates by itself. To hide the button from the start, add.woof[data-ajax-redraw="1"] .woof_submit_search_form { display: none; }to your theme's custom CSS.[woof redirect="..."]withoutajax_redraw: reload. Each change (or the Filter button, if autosubmit is off) reloads the page with the filter in the URL, and the table reads it when it loads. Slower to use, but the address bar always holds the current filter.
Older instructions use [woof is_ajax=1]. is_ajax is an attribute of [woof_products], not of [woof], which ignores it, so that combination runs in reload mode. Do not add [woof_products] to the table page: it prints a second, regular product list under the table.
Dependent filters that show only available options
Dependent filters are a HUSKY feature named Dynamic recount. When a shopper selects a value in one section, HUSKY recalculates every other section for the products that are still left, so options without results disappear. In WooCommerce → Settings → Products Filter → Options:
- Show count: Yes. Recount builds on the counts.
- Dynamic recount: Yes. The counts follow the current selection.
- Hide empty terms: Yes. Options with a count of 0 are hidden instead of shown greyed out.
Choose Product A, and the size section shows only Small and Medium if that is all Product A comes in. With ajax_redraw=1 this happens in place; in reload mode, after the reload.
Two related settings are worth knowing. Different sections always narrow each other: a colour and a size must both match. Within one section, two ticked checkboxes mean either one by default; to require both terms on the same product, open the additional options of that taxonomy on the Structure tab and set Logic of filtering to AND. For a guided selection, where the shopper answers one question at a time (base colour, then colour name, then style), HUSKY has a step-by-step filter extension with the [woof_step] shortcode; enable it on the Extensions tab and see its documentation on the HUSKY site.
Shareable URLs with the current filters
HUSKY keeps the filter in URL parameters: the search flag swoof=1 plus one parameter per section, for example:
https://example.com/price-list/?swoof=1&product_cat=shirts&pa_color=red,blue
A table with filter_provider='woof' reads these parameters when the page loads, so the link opens the table already filtered, with the same options ticked in the HUSKY form. This is how to share a filtered table with a customer, put it in a newsletter or link a menu item to a ready selection.
In reload mode the address bar always contains the current link, ready to copy. In the no-reload mode the address bar is not reliably updated on every change, so if shareable links matter more than avoiding reloads, use [woof] without ajax_redraw. A link can also be built by hand from the term slugs, which are shown under Products → Categories and Products → Attributes.
Other filter plugins: the product container selector and the hook
Many filter plugins ask for a "products container" or "product list selector", ul.products by default, and replace its contents after filtering. In a products table the rows sit in .woot-table tbody, one row per product. Entering that selector is usually not enough, though: such a plugin puts its own product markup, the cards of the shop loop, into the table body instead of table rows, and the table's columns, sorting and pagination stop matching what is shown.
A working connection passes the filter's results into the table's own query. The table calls the filter woot_filter_provider_{name} for every table with filter_provider='{name}', with the query arguments, the filter data and the shortcode arguments, and the plugin limits the query, usually by setting post__in to the IDs its filter found. The woot_filter_provider_ page shows the full HUSKY adaptation as a model, and the woot_wp_query_args hook covers simpler cases where a table only needs a fixed selection. The filter plugin also has to tell the table when to redraw, as HUSKY does with its event; that part is up to its developer.
Troubleshooting checklist
- The table ignores the filter: look for typographic quotes around
woofin the shortcode, and make sure HUSKY is active. - A filter change opens the shop page: add
redirectwith the address of the table page to[woof]. - The filter has no elements: no taxonomies or elements are enabled on the HUSKY Structure tab.
- Nothing happens after a change in no-reload mode: the attribute must be exactly
ajax_redraw=1, and the browser console must be free of JavaScript errors. Exclude both plugins' scripts from JavaScript delay and combine options of optimization plugins. - The filter is missing on the page: if Init plugin on the next site pages only is used on the HUSKY Advanced tab, add the table page to its list.
- The table shows the right products but options do not disappear: Show count, Dynamic recount and Hide empty terms must all be set to Yes.
- A second product list appears under the table: remove
[woof_products]from the page.
If the table and the filter still do not work together, open a topic on the WOOT support forum with a link to the page.