Category links

The “Categories” filter redirects users to a completely new context, instead of only narrowing down on selected products. This filter presents all categories on the same level. Users can also quickly navigate to the parent category. Depending on the user’s position in the category tree, different elements will be displayed. The following example will help illustrate this:

The user is at the top of the category tree, the “WooCommerce shop”
The list of top-level “Categories” is visible.

Top-level “Categories” of a WooCommerce shop
Caption: Top-level “Categories” of a WooCommerce shop

The user is in a “Category” which has further subcategories  (“children categories”)
The list of subcategories is visible. Users can click a link to go back to the previous level – if it is a top-level category, the link will navigate to the broadest context, which is the products from the entire store, specifically the “WooCommerce shop” page.

A first-level category: “Kitchen”
A first-level category: “Kitchen”

The user is in a “Category” which has no further subcategories
Same-level subcategories are visible. The current subcategory is highlighted. Users can click a link to go back to the previous level

A category of the second and subsequent level: "Kitchen -> Pots"
A category of the second and subsequent level: “Kitchen -> Pots”

Available options

Option nameDescription
Data sourceWhere should the checkbox items come from?
Read more about data sources.
Label for selected categoryThe label will appear above the category name.
Label for selected subcategoryThe label that will appear above the subcategory name.
Values orderIn what order should Radio list features be presented?

Alphabetically – sorts categories alphabetically

By counters – sorts categories by the total number of products assigned to a category

By term order – determines the sort order of the categories using custom order. Custom ordering is supported by WooCommerce, but there are plugins that do this job as well. Currently, we don’t support these plugins.

Modifying labels

When users are in the Category Archive, the filter header changes the default name from “Category” to the current category name. Please compare these screens:

Category” and “Subcategory” headers that are displayed above the category name can be changed depending on the context, or permanently. Below you can find an example of how to do this:

add_filter( 'fibofilters/filter/get_data', function ( $data, $context ) {

	// Break early if there is no category filter.
	if ( $context !== 'frontend-filtering'
		 || empty( $data['source'] )
		 || $data['source'] !== 'tax_product_cat' ) {
		return $data;
	}

	// Your custom conditions.
	if ( is_tax( 'product_cat', 55 ) ) {
		$data['label_category'] = 'New headline for category';
	}

	// Your custom conditions.
	if ( is_tax( 'product_cat', 105 ) ) {
		$data['label_subcategory'] = 'New headline for subcategory';
	}

	return $data;
}, 10, 2 );