WooCommerce Subscriptions by default activate a subscription only when the order status is at least Processing.
That means that also when the customer choose to pay with COD (Cash on Delivery), he will have the subscription active immediately after the checkout process completes.
It makes sense that the COD default status is not On Hold. The order needs to be processed before to get the payment, so On Hold would be wrong since you are actually processing the order, shipping it, and only then you receive the payment.
Sometimes though, with a subscription, this behaviour could be wrong.
There’s a way to put the subscription on hold when the customer choose to pay with COD. Open the file functions.php located in wp-content/themes/your-theme-name/ and add this code at the end of the file:
This code checks if the payment gateway used is COD, in that case, checks if the order status is Completed. If the gateway is that, but the order status is not Completed, the subscription status changes to “On Hold” so the customer can’t use it before you receive the payment.
You don’t have to worry about manually activating the subscription when you received the payment. As soon as you change the order status to Completed, the subscription status changes to Active automatically.
Leave a Reply