I registred a shipped order status, if I deactivated the plugin, the order will be hidden.
As an extra addition, it is the intention to change certain WooCommerce order statuses that currently have a status of "shipped" to "completed" after the plugin is deactivated
I tried this code but it doesn't work. Probably because I am applying this incorrectly?
add_action( 'woocommerce_order_status_changed', 'deactivate_plugin_conditional', 10, 2 );
function deactivate_plugin_conditional( $order_status, $order ) {
if( $order->has_status( 'shipped' ) ) {
return 'Complated';
}
}
Can someone push me in the right direction?