WooCommerce

FacetWP includes built-in support for WooCommerce. Facets can be created using most WooCommerce data, including:

  • Price
  • Sale Price
  • Regular Price
  • Average Rating
  • Stock Status (in stock / out of stock)
  • On Sale
  • Featured
  • Product Categories
  • Product tags
  • Product attributes

Create your facet

After adding some products, go to Settings > FacetWP and click the “Add facet” link.

For the facet’s Data source, select a choice under the WooCommerce header.

WooCommerce data source

WooCommerce variable products

FacetWP fully supports WooCommerce variable products. A full explanation of what this means for you (hint: it’s really powerful) can be found by watching this screencast.

Out-of-stock products

You can choose whether or not to show out-of-stock products from within FacetWP’s admin UI.

Add facets to your shop pages

For most themes, simply add some facet shortcodes into a sidebar text widget. FacetWP will automatically detect the products and display relevant facet choices.

Result counts or pagination not refreshing?

It’s possible that FacetWP didn’t automatically add its facetwp-template wrapper to the right spot. Try adding the following to your (child) theme’s functions.php:

<?php

function fwp_wrapper_open() {
    if ( ! is_singular() ) : echo '<div class="facetwp-template">'; endif;
}
function fwp_wrapper_close() {
    if ( ! is_singular() ) : echo '</div><!-- end facetwp-template -->'; endif;
}
add_action( 'woocommerce_before_shop_loop', 'fwp_wrapper_open', 5 );
add_action( 'woocommerce_after_shop_loop', 'fwp_wrapper_close', 15 );
add_action( 'woocommerce_no_products_found', 'fwp_wrapper_open', 5 );
add_action( 'woocommerce_no_products_found', 'fwp_wrapper_close', 15 );