• Resolved dekla

    (@dekla)


    Hello,
    How can I change the link when I click on the brand logo on the individual product page?

    Best regards

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

    (@titodevera)

    Hi dekla.

    Add the code below to your functions.php and customize as your needs:

    
    /**
     *  Add filter before single product brands for changing the brands url
     */
    add_action('pwb_before_single_product_brands', 'pwb_custom_before_single_product_brands');
    function pwb_custom_before_single_product_brands(){
    	add_filter('term_link', 'pwb_custom_filter_brand_link', 10, 3);
    }
    function pwb_custom_filter_brand_link( $url, $term, $taxonomy ) {
    	global $product;
    	if( $taxonomy == 'pwb-brand' ) $url = site_url('custom-url-here');
    	return $url;
    }
    
    /**
     *  Remove filter after single product brands for reset the default brands url
     */
    add_action('pwb_after_single_product_brands', 'pwb_custom_after_single_product_brands', -1);
    function pwb_custom_after_single_product_brands(){
    	remove_filter('term_link', 'pwb_custom_filter_brand_link', 10);
    }
    

    ??

    Thread Starter dekla

    (@dekla)

    Hi Titodevera

    Thanks for the reply
    I tried to enter the code like this: https://www.farmaciajorio.it/wp-content/uploads/2019/02/Cattura1234.jpg
    But don’t work

    I want to change the brand logo link
    like this pic:
    https://www.farmaciajorio.it/wp-content/uploads/2019/02/Cattura111111.jpg
    https://www.farmaciajorio.it/wp-content/uploads/2019/02/product.jpg

    Sincerely

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change brand link in single product page’ is closed to new replies.