Support » Plugin: Perfect Brands for WooCommerce » Show only tab content

  • Resolved peter.bohus

    (@peterbohus)


    Hi, I would like to show only content of tab (not in tab).
    I unset pwb_tab – which remove complete tab.
    Now I would like to show that content, but I cannot find how.
    ….also there is a logo and link to brand page, how can I disable it (hooked at: woocommerce_product_meta_end)?

    Thanks for help.

Viewing 1 replies (of 1 total)
  • Plugin Contributor titodevera

    (@titodevera)

    Hi peter.bohus.

    1) You can emulate the behavor of the tab:

    
     add_action( 'woocommerce_after_single_product_summary', function(){
    
    	 global $product;
    	 $brands = wp_get_object_terms( $product->get_id(), 'pwb-brand' );
    
    	 ob_start();
    	 ?>
    
    	 <h2><?php echo __('Brand', 'perfect-woocommerce-brands'); ?></h2>
    	 <?php foreach( $brands as $brand ): ?>
    
    		 <?php
    		 $brand_logo = get_term_meta( $brand->term_id, 'pwb_brand_image', true );
    		 $brand_logo = wp_get_attachment_image( $brand_logo, 'thumbnail' );
    		 ?>
    
    		 <div id="tab-pwb_tab-content">
    			 <h3><?php echo $brand->name;?></h3>
    			 <?php if( !empty($brand->description) ) echo '<div>'.$brand->description.'</div>';?>
    			 <?php if( !empty($brand_logo) ) echo '<span>'.$brand_logo.'</span>';?>
    		 </div>
    
    	 <?php endforeach; ?>
    
    	 <?php
    	 echo ob_get_clean();
    
     } );
    

    2) You can disable it from the settings page WooCommerce > Settings > Brands

    🙂

Viewing 1 replies (of 1 total)
  • The topic ‘Show only tab content’ is closed to new replies.