Hello,
Thank you for the reply. I have changed this but it does not seem to do anything, I have managed to (i think) solve it however and also implement it into the settings admin tab in PWB. Please feel free to use my addition (below) to your plugin if you like, it is the least I could do to say thank you for this plugin!
I’m not a great coder so please alter if it is wrong, but it seems to work.
Regards
Lee.
In file wp-content/plugins/perfect-woocommerce-brands/classes/class-perfect-woocommerce-brands.php
change public static function get_brands()
from line 713 to
public static function get_brands(){
$result = array();
$hide_empty_brands = get_option('wc_pwb_admin_tab_hide_empty_brands');
if( $hide_empty_brands !== 'no'){
$brands = get_terms('pwb-brand',array(
'hide_empty' => true
));} else {
$brands = get_terms('pwb-brand',array(
'hide_empty' => false
));
}
if(is_array($brands) && count($brands)>0){
$result = $brands;
}
return $result;
}
In file wp-content/plugins/perfect-woocommerce-brands/classes/class-pwb-admin-tab.php
add
'hide_empty_brands' => array(
'name' => __( 'Hide empty brands', 'perfect-woocommerce-brands' ),
'type' => 'checkbox',
'default' => 'yes',
'desc' => __( 'Hide empty brands if they contain no products', 'perfect-woocommerce-brands' ),
'id' => 'wc_pwb_admin_tab_hide_empty_brands'
),
at line 124 before section_end