Can We Show Different Options Depending On What Page The Filter Is On?
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page pleaseIf you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.
Quote from simonbbs on March 20, 2026, 22:50Hey Guys!
We have a specific filter that we are hoping we can add some conditional logic to.
In our "WooCommerce Brands" filter, is it possible for us to configure which Brands show in that filter depending on which Product Category page they are on?
Or a setting that ONLY shows brands that are applicable to that category?
Thanks so much!
-Simon
Hey Guys!
We have a specific filter that we are hoping we can add some conditional logic to.
In our"WooCommerce Brands" filter, is it possible for us to configure which Brands show in that filter depending on which Product Category page they are on?
Or a setting that ONLY shows brands that are applicable to that category?
Thanks so much!
-Simon
Quote from Alex Dovlatov on March 23, 2026, 13:06Hello Simon
Before we dive in, we want to make sure we understand what you actually need — because your request could mean two different things.
Option 1: You simply want the filter to show only brands that have products in the current category, so clicking any brand will always return results. If this is the case, no custom code is needed at all. Just go to WOOF settings, enable "Dynamic results count" and turn on "Hide empty positions". WOOF will then automatically hide any brand that has no products in the current category context.
Option 2: You have your own business logic and want full manual control — meaning you decide exactly which brands appear on each specific category page, regardless of whether they have products or not. For example, on the Electronics page you always show only brands A, B and C, and on the Clothing page only brands D and E. If this is what you need, we have a custom functions.php snippet ready that handles this via a category-to-brands mapping.
Could you confirm which of these two matches your goal? And if it is Option 2, one more thing we need from you: what is the taxonomy slug used by your Brands plugin? The most common values are "product_brands" or "pwb-brand" — you can check it in WP Admin under Products, it will be visible in the URL when you click on the Brands menu item.
/** * Shortcode [mywoof] — outputs WOOF filter with category-specific brand whitelist. * Usage: place [mywoof] in any widget, page or template. * * Map category slugs to brand term IDs that should be visible (whitelist mode). * On any category not listed, all brands are shown as usual. */ add_shortcode( 'mywoof', function() { // The taxonomy slug for your Brands plugin (adjust if needed) $brand_taxonomy = 'product_brands'; // Map category slug => brand term IDs to SHOW (comma-separated) $category_brands = array( 'electronics' => '23,45,67', 'clothing' => '12,89,34', 'furniture' => '56,78', 'sports' => '90,11,22', 'toys' => '33,44', ); if ( ! is_product_category() ) { return do_shortcode( '[woof]' ); } $term = get_queried_object(); if ( ! isset( $category_brands[ $term->slug ] ) ) { return do_shortcode( '[woof]' ); } // Save original settings $original_excluded = woof()->settings['excluded_terms'][ $brand_taxonomy ] ?? ''; $original_reverse = woof()->settings['excluded_terms_reverse'][ $brand_taxonomy ] ?? 0; // Patch settings: show ONLY the listed brand IDs for this category woof()->settings['excluded_terms'][ $brand_taxonomy ] = $category_brands[ $term->slug ]; woof()->settings['excluded_terms_reverse'][ $brand_taxonomy ] = 1; $output = do_shortcode( '[woof]' ); // Restore original settings woof()->settings['excluded_terms'][ $brand_taxonomy ] = $original_excluded; woof()->settings['excluded_terms_reverse'][ $brand_taxonomy ] = $original_reverse; return $output; } );
Hello Simon
Before we dive in, we want to make sure we understand what you actually need — because your request could mean two different things.
Option 1: You simply want the filter to show only brands that have products in the current category, so clicking any brand will always return results. If this is the case, no custom code is needed at all. Just go to WOOF settings, enable"Dynamic results count" and turn on"Hide empty positions". WOOF will then automatically hide any brand that has no products in the current category context.
Option 2: You have your own business logic and want full manual control — meaning you decide exactly which brands appear on each specific category page, regardless of whether they have products or not. For example, on the Electronics page you always show only brands A, B and C, and on the Clothing page only brands D and E. If this is what you need, we have a custom functions.php snippet ready that handles this via a category-to-brands mapping.
Could you confirm which of these two matches your goal? And if it is Option 2, one more thing we need from you: what is the taxonomy slug used by your Brands plugin? The most common values are"product_brands" or"pwb-brand" — you can check it in WP Admin under Products, it will be visible in the URL when you click on the Brands menu item.
/**
* Shortcode [mywoof] — outputs WOOF filter with category-specific brand whitelist.
* Usage: place [mywoof] in any widget, page or template.
*
* Map category slugs to brand term IDs that should be visible (whitelist mode).
* On any category not listed, all brands are shown as usual.
*/
add_shortcode( 'mywoof', function() {
// The taxonomy slug for your Brands plugin (adjust if needed)
$brand_taxonomy = 'product_brands';
// Map category slug => brand term IDs to SHOW (comma-separated)
$category_brands = array(
'electronics' => '23,45,67',
'clothing' => '12,89,34',
'furniture' => '56,78',
'sports' => '90,11,22',
'toys' => '33,44',
);
if ( ! is_product_category() ) {
return do_shortcode( '[woof]' );
}
$term = get_queried_object();
if ( ! isset( $category_brands[ $term->slug ] ) ) {
return do_shortcode( '[woof]' );
}
// Save original settings
$original_excluded = woof()->settings['excluded_terms'][ $brand_taxonomy ] ?? '';
$original_reverse = woof()->settings['excluded_terms_reverse'][ $brand_taxonomy ] ?? 0;
// Patch settings: show ONLY the listed brand IDs for this category
woof()->settings['excluded_terms'][ $brand_taxonomy ] = $category_brands[ $term->slug ];
woof()->settings['excluded_terms_reverse'][ $brand_taxonomy ] = 1;
$output = do_shortcode( '[woof]' );
// Restore original settings
woof()->settings['excluded_terms'][ $brand_taxonomy ] = $original_excluded;
woof()->settings['excluded_terms_reverse'][ $brand_taxonomy ] = $original_reverse;
return $output;
} );
Quote from simonbbs on March 23, 2026, 20:17Good Afternoon Alex,
Thank you a ton for the information here.
I think option #1 is exactly what we are looking for, but it is good to know option #2 exists.
I attempted to test option #1, however, that dropdown is blocked off for us: https://www.dropbox.com/scl/fi/ran1u0pm9wrkerlfholix/For-Support.png?rlkey=g91aquf1fvb8twgk0apv3mjw8&st=4o4vde79&dl=0
Am I correct in my understanding that we need to upgrade to the paid version of the plugin to unlock that option?
Thanks so much!
-Simon
Good Afternoon Alex,
Thank you a ton for the information here.
I think option #1 is exactly what we are looking for, but it is good to know option #2 exists.
I attempted to test option #1, however, that dropdown is blocked off for us: https://www.dropbox.com/scl/fi/ran1u0pm9wrkerlfholix/For-Support.png?rlkey=g91aquf1fvb8twgk0apv3mjw8&st=4o4vde79&dl=0
Am I correct in my understanding that we need to upgrade to the paid version of the plugin to unlock that option?
Thanks so much!
-Simon
Quote from Alex Dovlatov on March 24, 2026, 17:04Hello Simon
Yes, "hide empty terms" is in premium version of the plugin, but sure you can try option #2 :)
Welcome!
Hello Simon
Yes,"hide empty terms" is in premium version of the plugin, but sure you can try option #2 :)
Welcome!
