In my woocommerce 2.4.8 when changing order status in admin panel
if ( 'completed' == $order_status && ( 'on-hold' == $order->status || 'completed' == $order->status || 'failed' == $order->status ) ) { function my_func(); } a certain function should be performed, but I don’t understand where it is better to register it ... in woocommerce files or in functions.php. If in functions.php, then how will the logic be built ???
add_action('woocommerce_order_status_completed', 'my_compl'); function my_compl_2() { .............. } It would be nice to make woocommerce in the files themselves so that it does not depend on the templates.