You can catch specific status change by using this action hook ‘woocommerce_order_status_{status}’. It is defined in the WC_Order class.
This is how you define it:
/**
* Executed when the status is changed to failed.
* @param int $order_id
* @param \WC_Order $order
*/
function wpdg_9291_woocommerce_order_status_failed( $order_id, $order ) {
// Do something here
}
add_action('woocommerce_order_status_failed', 'wpdg_9291_woocommerce_order_status_failed', 15, 2);
Related Posts:
- Is there a Woocommerce hook that fires when applying a coupon but before checking if it’s valid?
- Display custom product option in admin order details
- Show only geolocated user country into Woocommerce checkout country fields
- Remove action on product archive page [closed]
- Woocommerce – Hide a Column in Cart Table
- Using a filter with multiple parameters and $this
- Which hook should I use to capture $_POST(‘password’) via profile update and password reset
- Edit WooCommerce product content based on category
- Redirect customer to login page (with other signup plugin) if user not logged in when proceeding to checkout
- How to list all WC products by their attributes values?
- WooCommerce Hook: Content get’s displayed twice and not AFTER the order total
- Redirect no product url’s to static url
- What Hook/Action is performed when a field in checkout form is changed in WooCommerce
- password_reset doesnt work
- Woocommerce – Adding row to cart table
- How to access page variable inside action hook
- manage_shop_order_posts_custom_column() hook is Not working In Functions.php file in my WordPress active theme
- Woocommerce : Add name filed of checkout page to buyers wordpress display name
- Combine one action and one filter
- Parameters in woocommerce_before_add_to_cart_button hook
- How can i add product Accessories from front-end using custom php form?
- How to change lost password email text using custom plugin wordpress?
- Overriding Plugin function in your child theme
- Add suffix to price html does not work
- With what hook do I remove WooCommerce existing Product Data Tab form fields?
- How to add custom checkout field in user details mail template
- Add second price option based on payment method at cart item price
- Reposition variation stock message
- How can I edit post data before it is saved?
- Trouble understanding apply_filters()
- How to only hook on Single.php after content?
- How to remove action hook done in a plugin from functions.php in my theme?
- Implementing advanced add_* function wrappers
- Filter hook before create order WooCommerce
- How to get rid of the hover zoom in WooCommerce single products
- How to change Woocommerce breadcrumbs content?
- Hook and send Woocommerce data after click Place Order button
- Please explain me what the do_action does
- do_action and hook methods
- Reverse engineering of WooCommerce Storefront filters
- How does WordPress call functions attached to a certain action hook before calling functions attached to other hooks
- WordPress codex: apply_filters – clarification on creating a new hook on the fly. How do we use it?
- How to prevent action in ajax request, when in admin side?
- Add my own function to existing WooCommerce hook
- Is possible dequeue/remove style from wp_footer() hook and add on wp_head() hook?
- How can i do something after head like adding a hook for after head but before post
- How to call a function or method that is Namespaced using another plugin
- How to change currency programmatically on creating order action?
- Accessing parameters when adding filter
- How to change the order (priority) of registered filters (or actions) (e.g. for the_content)?
- How do action and filter hooks understand where to look for the core function that we hooked our function to them
- How can I add an additional action button into the woocommerce admin order page?
- differentiate hooks and filters on the same page [closed]
- Prefixing plugin hooks (actions/filters) with a wrapper class or functions
- ‘profile_update’ hook alternative for WooCommerce user meta data
- Contact Fom 7 – how to add custom HTML inside span.wpcf7-form-control-wrap AND IMMEDIATELY AFTER input.wpcf7-form-control?
- How to subscribe free subscription on user registration in woocommerce subscription plugin?
- Showing the WordPress standard text area on a Woocommerce Single Product Page?
- Execute JavaScript in WordPress Hook
- How can I output all apply_filters and do_action?
- Override the WordPress core function wp_referer_field
- Woocommerce: Complex query in pre_get_posts [closed]
- woocommerce_new_product action doesn’t fire
- How to re-arrange this hooked content?
- Pre filter woocommerce products to remove a certain category of products
- Hook add_attachment error
- How to add order status class to the body tag?
- Get The Caller (Plugin / Theme / Core) For All actions & Hook in WordPress
- How can I remove a WooCommerce Product Tab’s sub section in wp-admin?
- Functions.php change for Woocommerce not working
- How to find list of all functions bind to a particular hook from my plugin?
- How to hook into action/filter call
- How to create a WooCommerce Product filter based on PHP foreach
- Use ID as slug for product category by default in WooCommerce?
- What is the problem with these lines of code?
- Two Filter Issue [closed]
- call_user_func_array() expects parameter 1 to be a valid callback, class ‘WC_Rapyd’ does not have a method ‘install’
- Help to locate a woocommerce hook method
- Hook to add content after date in post?
- woocommerce_add_to_cart custom function called several times
- How to track product price changes?
- Filter orders in Admin area based on logged in user
- Display product thumbnail in Woocommerce email notifications
- WordPress Plugin Boilerplate – add actions and/or filters based on user’s role
- How can I locate where the actions are defined? [duplicate]
- {status}_{post_type} does not run correctly?
- woocommerce price filter not working when change currency
- Hide add to cart when product variation has no price or is unavailable
- Hook woocommerce price in backend order edition
- WooCommerce Admin Only Email Hook
- Why can’t I shove an instance of a class into a variable from a do_action hook?
- Passing a parameter to filter and action functions
- add query string to all pages after user logged in
- WooCommerce comments_template Filter Not Firing
- Can a woocommerce hook alter the UI of a website?
- Order shipped by which driver[hook for woocoomerce order staus changed and popup in admin panel ] [closed]
- dakon show vender address on checkout page
- Is there any filter or action hook to remove layout classes from appearing in my templates?
- Add text when displying attribute with a hook on single product page
- Add custom ID to WooCommerce product tab