• Resolved carlcs

    (@carlcs)


    I wish to remove the paypal checkout buttons based on certain conditions our users must satisfy before they’re allowed to purchase a product. I was able to trace it to this line

    add_action( 'woocommerce_after_add_to_cart_form', array( $this, 'display_paypal_button_product' ), 1 );

    in the class WC_Gateway_PPEC_Cart_Handler. how do i execute the equivalent remove action call for this since it’s a class in a class and i couldn’t find any global declarations i could use to reference the function?

    Thanks

    • This topic was modified 5 years, 6 months ago by carlcs.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter carlcs

    (@carlcs)

    I did some investigation and found the function wc_gateway_ppec()

    i used that function this way.

    if (function_exists('wc_gateway_ppec')) {
        remove_action( 'woocommerce_after_add_to_cart_form', array( wc_gateway_ppec()->cart, 'display_paypal_button_product' ), 1 );
    }

    is this method correct?

    Hi @carlcs,

    That does look correct, did it work for your site? Please let us know ??

    Hi there @carlcs,

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove paypal checkout button based on certain conditions’ is closed to new replies.