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
- WooCommerce Webhook Action When a New Product Review was Submitted/Created
- 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
- What’s the difference between WC() and $woocommerce
- How to change Woocommerce breadcrumbs content?
- Hook and send Woocommerce data after click Place Order button
- How to debug removal of rewrite rule flushing?
- 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
- When to use actions and when to use filters
- 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)?
- Remove Order List Row Link in WooCommerce Admin?
- 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
- Woocommerce “added to cart” message on main(home) page
- How to apply these filters
- How to exclude a taxonomy from shop & search page wooCommerce?
- How to change a WooCommerce Subscription Deposit and Monthly Payment? [closed]
- How can I add a so i can show sale price under normal price
- WooCommerce checkout page price break down table hook
- How to access deleted term inside delete_product_cat action
- How to output woocommerce products to a page, style and modify the html structure
- Remove tags without a specific meta key from “choose from the most used tags”
- Redirect to woocommerce checkout after adding to cart – item already in cart
- How can I edit comment meta value before it is saved?
- Action hook to control access to certain parts of my site
- How do I create a filter to hide the One Click Accessibility plugin button in WordPress?
- How to alter taxes amounts when updating an order
- Hooks For Design variation in woo commerce single product page
- How to add woocommerce products header title in woocommerce_breadcrumb hook to function.php
- apply_filters() and call_user_func() to define and call a function outside a class
- apply_filter and add_filter conflict
- Woocommerce – Hide shipping at all, if only certain product or products with certain shipping class is in the cart
- Running JavaScript after using WooCommerce Filter Plugin
- Assign user role by text field in WordPress (Woocommerce) [closed]
- How to display two different custom taxonomy terms on a WooCommerce single product page
- How Do I Unhook This Parent Theme Function?
- How to add woocommerce product price filter widget to other page
- Unable to call woocommerce hook in my custom php file
- Use action, filter, or hook to append HTML to WordPress plugin function
- Remove username and account password field from checkout page
- WooCommerce Tax Filter Not Working
- Woocommerce add a text field if specific option is selected
- Create woocommerce order on new user registration
- Put data in my-account/view-order/id/ page
- How Do I Access Parameters Emitted by an Action?
- Hook inside a hook
- AffiliateWP not calculating multiple quantities when using affwp_calc_referral_amount filter
- Hide a shipping method if cart total is higher than an amount
- Ninja Forms: Front-End Forms, Post ID?
- Modify upload directory to use post category slug in file path on multisite installation