• Resolved sroskylos

    (@sroskylo1)


    Hello
    How can i disable the brand page link from the loop when showing all products on the same brand page?

    Example: Disable the link mybrand on the loop when you viewing the brands/mybrand

    Is this possible?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor titodevera

    (@titodevera)

    Hi sotos.

    Here is some magic for you, add this to your ‘functions.php’:

    
     /**
      * Disable the brand page link from the loop when showing all products on the same brand page
      */
    add_action( 'wp', function(){
    
    	if( !is_tax( 'pwb-brand' ) ) return;
    
    	$hook_name = 'woocommerce_after_shop_loop_item_title';
    	global $wp_filter;
    
    	foreach( $wp_filter[$hook_name] as $callbacks ){
    
    		foreach( $callbacks as $callback_key => $callback ){
    
    			if( strpos( $callback_key, 'show_brands_in_loop' ) ){
    				remove_action( 'woocommerce_after_shop_loop_item_title', $callback_key );
    				break 2;
    			}
    
    		}
    
    	}
    
    } );
    

    ??

    Thread Starter sroskylos

    (@sroskylo1)

    Awesome ?? Thank you so much ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Disable Link On Brand Page’ is closed to new replies.