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

rename product categories in filter menu?

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.

Hi is it possible to rename a product category inside the filter menu?

For example in the image below, how can I rename the last category to read"Child Category with custom text"?

woof category with custom text

Is this possible?

Thank you

Hello

Unfortunately, the plugin does not have such a feature, you need code customization.

Use  this  hook to find  an  rename  this  term - https://products-filter.com/hook/woof_sort_terms_before_out

Hi I found some code that uses woof_sort_terms_before_out but it only shows the categories I add to the array which I don't want to do as there's lots of categories and only 2 need to be renamed. Also I am not sure how to rename them within this PHP snippet. Please can you advise if possible?

Would it be possible to echo all the categories out by default and if category ID 1019 found then change the text to Test 123 and if category ID = 1697 found change text to Test 456?

 

add_filter('woof_sort_terms_before_out', function($terms,$type){

$new_terms=array();

foreach($terms as $term){
if($term['taxonomy']=="product_cat" AND in_array($term['term_id'],array(1019,1697))){
$new_terms[]=$term;
}
}

if($new_terms) {
return $new_terms;
}

},99,2);

Hello

An  example:

add_filter('woof_sort_terms_before_out', function($terms,$type){

$new_terms=array();

foreach($terms as $key => $term){
if($term['taxonomy']=="product_cat" AND in_array($term['term_id'],array(1019,1697))){

if ($term['term_id'] == 1019) {

$terms[$key ]['name'] ="Test 123";

}

if ($term['term_id'] == 1697) {

$terms[$key ]['name'] ="Test 456";

}

}
}

return $terms;

},99,2);

Wow great stuff! That works perfectly! Thanks so much!!

Hello

Welcome;)