Can someone please help me.
I have a shipping plugin what add a Bulk action at orders admin page in woocommerce. It's an action and if I choose it it send order shipping data to the GLS automatically, but we need too call it always fron the admin page.
We have a windows based invoice and stock program, what can get the orders from woocommerce and can change the status too.
We want to call the above action from this program too.
So I need to call this action automatically when I change the orders status in the program into my custom order status.
I had a custom status, and the program is send back to woocommerce the status change and it works well. I only need a solution, how can I call the bulk action to process when I change the order status.
$path = "./wp-content/plugins/wc-pont/includes/mygls.php";
include_once($path);
add_action( 'woocommerce_order_status_changed', 'callaction', 10, 2 );
function callaction( $order_id, $action ){
global $woocommerce;
$order = new WC_Order( $order_id );
if ( $order->status == "mycustomorderstatus" ) {
exportGLS($order_ids); //this is the function what is in the mygls.php and what I need to call.
}
}
Thank you for your helps.
the same action you just need to check for $_REQUEST['post'] to get the ids