Support » Plugin: WooCommerce » Hook for removing coupon on admin order edit screen

  • Resolved benorgan

    (@benorgan)


    We are trying to hook into the removal of a coupon on the admin order edit screen but this doesn’t seem to be possible. For the end-user cart we can use woocommerce_removed_coupon but this doesn’t seem to fire on the order edit screen.

    Looking at the code this functionality seems to be handled by the remove_order_coupon function in class-wc-ajax.php (which in turn calls remove_coupon in abstract-wc-order.php). However, neither of these functions triggers any action that we can hook into.

    What is the recommended approach to hook into a coupon being removed by the admin when editing an order?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support RK

    (@riaanknoetze)

    Hi there,

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the following places for more development-oriented questions:

    1. WooCommerce Slack Community: https://woocommerce.com/community-slack/
    2. Advanced WooCommerce group on Facebook: https://www.facebook.com/groups/advanced.woocommerce/
    Plugin Support Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Hi @benorgan!

    Are you wanting to remove the ability to add a coupon from the order edit screen or is there something else you’d like to achieve here?

    Cheers!

    Plugin Support Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Howdy!

    We haven’t heard back from you in a while, so I’m going to go ahead and mark this thread as resolved. If you have any other questions please start a new thread.

    Cheers!

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.