• Resolved fabioto89

    (@fabioto89)


    Hello Skhea, I’m trying to remove de Review and description tabs from just one specific product, but I’m facing problems because the code aplly to all site…

    </li>
    </blockquote>

    add_filter( ‘woocommerce_product_tabs’, ‘woo_remove_product_tabs’, 98 );

    function woo_remove_product_tabs( $tabs )
    {
    //if ( ! is_product( ‘lanterna’ ) ) return;

    unset( $tabs[‘description’] ); // Remove the description tab
    unset( $tabs[‘reviews’] ); // Remove the reviews tab
    unset( $tabs[‘additional_information’] ); // Remove the additional information tab,

    return $tabs;
    }`

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Hi @fabioto89,

    You need to either include the full slug or post ID in the call to is_product():

    add_filter( 'woocommerce_product_tabs', function ( $tabs ) {
    	if ( ! is_product( 4911 ) ) return $tabs;
    
    	unset( $tabs[ 'description' ] ); // Remove the description tab
    	unset( $tabs[ 'reviews' ] ); // Remove the reviews tab
    	unset( $tabs[ 'additional_information' ] ); // Remove the additional information tab,
    
    	return $tabs;
    }, 98 );
Viewing 1 replies (of 1 total)
  • The topic ‘Remove Review tab from one product’ is closed to new replies.