I want to execute the following code only when product is virtual and downloadbl
-
Hello,
I would like to execute the following code only when the product is a virtual and downloadable, could you please tell me how to do that?add_action('woocommerce_order_status_changed', 'auto_update_processing_to_complete'); function auto_update_processing_to_complete($order_id) { if ( ! $order_id ) { return; } $order = wc_get_order( $order_id ); if ($order->data['status'] == 'processing') { $order->update_status( 'completed' ); } }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘I want to execute the following code only when product is virtual and downloadbl’ is closed to new replies.