• Resolved gkastorinis

    (@gkastorinis)


    I am trying to unhook the show_button, on single product, to move it, but it is not happening.

    Please take a look on my code.

    add_action( 'init', 'remove_button', 10 );
    function remove_button() {
    global $YITH_PayPal_EC_Frontend;
    remove_action( 'woocommerce_after_add_to_cart_form', array( 'YITH_PayPal_EC_Frontend', 'show_button' ), 10 );
    }

    Can you help me ?

    • This topic was modified 6 years, 3 months ago by gkastorinis.
    • This topic was modified 6 years, 3 months ago by gkastorinis.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi,
    Try with this code

    add_action( 'init', 'remove_button', 10 );
    function remove_button() {
    	if( function_exists('YITH_PayPal_EC_Frontend')){
    		$paypal_ec_frontend = YITH_PayPal_EC_Frontend();
    		remove_action( 'woocommerce_after_add_to_cart_form', array( $paypal_ec_frontend, 'show_button' ), 10 );
    	}
    
    }
    Thread Starter gkastorinis

    (@gkastorinis)

    Thank you.

    It worked like a charm

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Moving paypal button on single product’ is closed to new replies.