feedback suggestion: autocompleting status on virtual orders
-
Hi, after having had some trouble implementing it, I would like to ask you to consider adding an option to woocommerce that allows to choose that not only on virtual+downloadable products the order status automatically changes to completed, but also on virtual non-downloadable products.
This would make a lot of sense since many folks sell online events such as webinars on their websites these days, combining wordpress + woocommerce + some event plugin, in which the event plugin waits for the order status to be completed.
If you do not consider adding this option, could you at least then update your documentation and snippet on this page: https://woocommerce.com/document/automatically-complete-orders/
The snippet offered on this page is not at all the best solution, as it triggers on the rendering of the “thank you” page, while in my personal experience and of others, there are many scenarios in which this page does not appear. The following post offers a much better solution: https://stackoverflow.com/questions/35686707/woocommerce-auto-complete-paid-orders/35689563#35689563
add_action( ‘woocommerce_payment_complete_order_status’, ‘wc_auto_complete_paid_order’, 10, 3 );
function wc_auto_complete_paid_order( $status, $order_id, $order ) {
return ‘completed’;
}
Here the filter “woocommerce_payment_complete_order_status” is used, making it independent of interface rendering, and much more reliable.
I am sure this would save a lot of people frustration and research.
Thank you.
- The topic ‘feedback suggestion: autocompleting status on virtual orders’ is closed to new replies.