I want to change status order after payment for all products under category private
I tried this code but it works for all products, I need it works with products under category private only
`add_action( ‘woocommerce_order_status_processing’, ‘processing_to_completed’);
function processing_to_completed($order_id){
$order = new WC_Order($order_id);
$order->update_status('refunded');
}`
can any one help me?
add_action( ‘woocommerce_order_status_processing’, ‘processing_to_completed’);
function processing_to_completed($order_id){
$order = new WC_Order($order_id);
$order->update_status('refunded');
}
2
Answers
You have to check the items in your order and if any of the items is from specific category to change the order status.