Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Created February 13, 2020 06:30
Show Gist options
  • Save webtoffee-git/cf338d1a4203180ba57b9094cdef5a70 to your computer and use it in GitHub Desktop.
Save webtoffee-git/cf338d1a4203180ba57b9094cdef5a70 to your computer and use it in GitHub Desktop.
Make order status completed when an order is placed - WebToffee WooCommerce Subscriptions
add_action( 'woocommerce_order_status_processing', 'processing_to_completed');
function processing_to_completed($order_id){
$order = new WC_Order($order_id);
$order->update_status('completed');
}
@patrikalienus
Copy link

Do you know why WooCommerce Subscriptions do not automatically set the order as Completed when the card has been charged? I mean, it's a virtual product so it should be made Completed. Since it's an official plugin by Automattic, I find it strange that they've chosen to neglect this obvious flaw. That is, unless I'm missing something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment