• Hello,

    I was trying to remove compare button from product loop default position. Use remove_action hook but its not working.

    I was trying both way from my theme and plugin.

    remove_action('woocommerce_after_shop_loop_item', ['YITH_Woocompare_Frontend', 'add_compare_link'],20 );
    
    
    
    global $yith_woocompare;
    remove_action( 'woocommerce_after_shop_loop_item', [ $yith_woocompare->obj, 'add_compare_link' ], 20 );
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Alessio Torrisi

    (@alessio91)

    Hi there,

    unfortunately this feature is not available in this version of the plugin, I can’t provide support for it.

    For any question get in touch with us at https://yithemes.com.

    Thanks for your time.

    Thread Starter shahadul878

    (@shahadul878)

    We are using your plugin in our premium theme. Our product loop and design are different from the default. For this reason, we need to change your button position. How can we remove your default position? If it’s not possible to change button position, we need to remove your plugin’s support from all of our themes.

    Plugin Support crodriguez1991

    (@crodriguez1991)

    Hello there,

    I hope you’re doing well ??

    In order to remove the compare button, you can try to add the following code in the functions.php of your active theme:

    if( !function_exists('yith_disable_compare') ){
        add_action('template_redirect','yith_disable_compare');
    
        function yith_disable_compare(){
            global $yith_woocompare;
                remove_action( 'woocommerce_after_shop_loop_item', array( $yith_woocompare->obj, 'add_compare_link' ), 20 );
        }
    }

    Please, try it and let me know.

    Have a good day.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can’t remove compare button’ is closed to new replies.