• Resolved stieranka

    (@stieranka)


    Hi,
    please add function that hides BRAND TAB if the product has no brand or there is no image or text in the brand description. Not every product has a brand.
    I think it would be very useful…

    Steve

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter stieranka

    (@stieranka)

    You can change the function in a file /perfect-woocommerce-brands/classes/class-pwb-product-tab.php

    
      public function product_tab( $tabs ) {
        global $product;
        $brands = wp_get_object_terms( $product->get_id(), 'pwb-brand' );
    	if ( ! empty( $brands ) ) { // if exist brand
    		$show_brand_tab = get_option( 'wc_pwb_admin_tab_brand_single_product_tab' );
    		if( $show_brand_tab == 'yes' || !$show_brand_tab ){
    		  $tabs['pwb_tab'] = array(
    			'title' 	  => __( 'Brand', 'perfect-woocommerce-brands' ),
    			'priority' 	=> 20,
    			'callback' 	=> array( $this, 'product_tab_content' )
    		  );
    		}
    		return $tabs;
    	}
      }
    
    
    Plugin Contributor titodevera

    (@titodevera)

    Hi stieranka

    I will include this tweak for the next release

    ??

    Plugin Contributor titodevera

    (@titodevera)

    Hi stieranka!

    The new version 1.7.4 is out now and solves this issue.

    Update your plugin please ??

    Thread Starter stieranka

    (@stieranka)

    Hi titodevera,

    I try, it works fine. Thank you for fast fix ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Disable BRAND TAB when product not have brand’ is closed to new replies.