PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Error with Categories

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 please
If 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.

Hello,

I have a problem with the plugin, namely it does not want to display “Banery reklamowe” and its subcategories in the main categories. They are supposed to be visible on a separate page, dedicated under it. In addition, the active category - is never at the top, despite the option checked in the settings. Finally, when you go to a category from a product using breadcrumbs, the subcategories in the filters on the left are not visible - it is empty.

My website: http://www.zasadamedia.pl

https://ibb.co/CpfV564C
https://ibb.co/MyHpPZRZ
https://ibb.co/4w3jSCWc

I'm waiting for your response.

 

Thanks, Lukas

Hello Lukas

Please paste your license key here - https://share.pluginus.net/image/i20230222134241.png -> https://share.pluginus.net/image/i20230222134511.png

Update the plugin to latest version  - https://products-filter.com/how-to-make-auto-update-for-wordpress-plugins-and-themes-bought-on-envato

My test - https://c2n.me/4mfH3RO.png

Please note that only child categories are displayed on the category page. If the current category does not have child elements, the filter will not show the categories.  It makes sense to show only child categories( of the current category ), because clicking on any other category will always give zero products )

Please, check to click another category for e.x."Kubki". I have the newest version of extesion. I filled the license key and access to Wordpress Admin. The category from breadcumb have subcategories, so It's wired.

Hello

Ok!"Kubki" - Yes, everything works correctly, this category has no child elements

Check another for e.x."Dla dzieci" - click from breadcumbs. https://zasadamedia.pl/kategoria-produktu/upominki/dla-dzieci/pluszaki-i-maskotki/ It doesn't show the categories which contains. What about the rest of configuration? How to hide all categories from"Banery reklamowe" on"Upomiki" site and from filters?

My  test - https://share.pluginus.net/image/i20250211112216.png

It's not that I needed. I would like to hide this categories from attachment from search result. And it will appears on a diffrent page which name"Banery reklamowe" not in the Shop page.

 

https://ibb.co/4Z2BBTCr

Hello

To implement your custom functionality you need custom code

You  can use this hook - https://products-filter.com/hook/woof_sort_terms_before_out

I have added the following code to exclude the category 525 from filters and search results, but It still doesn't work :

 

add_filter('woof_sort_terms_before_out', function($terms, $type) {
if ($type !== 'checkbox') {
return $terms;
}

$excluded_category_id = 525;

if (is_product_category()) {
$queried_object = get_queried_object();
$current_category_id = $queried_object->term_id;

// Pobranie ID wszystkich dostępnych podkategorii
$child_categories = get_terms(array(
'taxonomy' => 'product_cat',
'child_of' => $current_category_id,
'hide_empty' => false
));

$child_category_ids = wp_list_pluck($child_categories, 'term_id');

$terms = array_filter($terms, function ($term) use ($current_category_id, $child_category_ids, $excluded_category_id) {
return (in_array($term['term_id'], $child_category_ids) || $term['term_id'] == $current_category_id) && $term['term_id'] != $excluded_category_id;
});
} else {

$terms = array_filter($terms, function ($term) use ($excluded_category_id) {
return $term['term_id'] != $excluded_category_id;
});
}

return $terms;
}, 10, 2);

Hello

In this case, you'd better contact the author of this third-party code.