Woocommerce remove an action hook

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

Read More
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?

Related posts

Leave a Reply

3 comments

  1. 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.

  2. Try increasing the priority.

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

    Edit: Follow the comments below and dont use this as it is, what i meant by increasing priority was to gradually increase the priority till it matches the time when function was added, when it does match you will automatically see the results else it just wont work. Thank you everyone for making it clear.