If you want to hide the Add to Compare button for specific products you can use the following filter hook:

add_filter( 'woocommerce_better_compare_show_add_to_compare_button' ,'hide_compare_btn', 10, 2);
function hide_compare_btn( $show, $product ){
    
    if($product->get_id() == 123) {
		$show = false;
	}	
	
    return $show;
}

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *