This topic has 2 replies, 2 voices, and was last updated 1 hours, 3 minutes ago ago by Luca Rossi
I have noticed that WooCommerce by default, sets the order status to “processing” when an order is placed. However, since I only sell downloadable products, I am concerned that my customers may be confused by receiving an email stating that their order is being processed, especially when the same email also includes their download link. Is there a way to automatically set these orders to “completed” as soon as the payment is received?
Best regards,
Trine
Dear @Woolwolf,
We hope this message finds you well.
To address your request, please try adding the following custom code to the functions.php
file located in your child theme:
add_action( 'woocommerce_payment_complete', 'wpdesk_set_completed_for_paid_orders' );
function wpdesk_set_completed_for_paid_orders( $order_id ) {
$order = wc_get_order( $order_id );
$order->update_status( 'completed' );
}
For further details and guidance, you may refer to this article: [WooCommerce Payment Complete Hook](https://wpdesk.net/blog/woocommerce_payment_complete-hook/).
Should you have any questions or need additional assistance, please feel free to reach out.
Best regards,
The 8Theme Team.
You must be logged in to reply to this topic.Log in/Sign up