i want to call my custom function on Bulk order status changed, to add some additional functionality. for that i tried following hooks but nothing work..
add_action( 'admin_action_woocommerce_order_status', 'bulk_order_my_function' );
add_action( 'admin_action_woocommerce_order_status_processing', 'bulk_order_my_function' );
add_action( 'admin_action_wc_processing', 'bulk_order_my_function' );
add_action( 'admin_action_woocommerce_processing', 'bulk_order_my_function' );
i am more interested in general order status hook for bulk order update instead of creating separate function for each status.. i.e: so in my one function bases on IF/ELSE condition i can put my logic.
Would be grateful if anyone can help?
So i downloaded the whole woocommerce package and find the string bulk in the woocommerce folder and certainly i found the hook in the below mentioned file:
\woocommerce\includes\admin\list-tables\abstract-class-wc-admin-list-table.php
hook we can use is
add_filter( 'handle_bulk_actions-edit-shop_order', 'bulk_order_stock_update', 10, 3 );
function will be some thing like following
function bulk_order_stock_update($redirect_to, $action, $ids) {
if ( false !== strpos( $action, 'mark_' ) ) {
$new_status = substr( $action, 5 ); // Get the status name from action.
$report_action = 'marked_' . $new_status;
//place your some condition here....
}
}