Woocommerce删除动作钩子

I am using woocommerce plugin in my wordpress site. I want to remove a function named 'woocommerce_checkout_coupon_form' which is hooked in to the action 'woocommerce_before_checkout_form'.

I tried adding the below code in my theme functions.php

add_action('init','remove_coupon_text',10);
function remove_coupon_text() {
    remove_action('woocommerce_before_checkout_form','woocommerce_checkout_login_form',10);
} 

But this is not working. Any idea?

Sorry it was a mistake from my side. I used the wrong function name. The function name I intended to remove was 'woocommerce_checkout_coupon_form'. The issue is fixed now.

Try increasing the priority

remove_action('woocommerce_before_checkout_form','woocommerce_checkout_login_form',1);

Try this

remove_all_actions( $tag, $priority );