If a customer has created a subscription using a payment gateway with automatic recurring payment support, and the customer now wants to pay manually, the store manager can use this tutorial to switch their subscription to manual payments.
The first part of this guide is written for store owners and outlines the administration interface available for this purpose. The second part of the guide is written for developers and provides information on how to programmatically change a subscription’s payment method to manual.
Store Manager Guide to Change a Subscription to Manual Payments
To change a customer’s subscription via the administration interface:
- Go to the WooCommerce > Subscriptions administration screen.
- Click the ID of the subscription you want to change to open the Edit Subscriptions screen.
- Click the pencil icon next to the Billing Details section.
- Click the Payment Method select box at the bottom of Billing Details.
- Choose Manual.
- Click Save Subscription.
Developer Guide to Change a Subscription to Manual Payments
If you need to switch a large number of subscriptions to use manual renewals, and you are proficient with PHP and/or MySQL, you can also programmatically change a subscription’s payment method to be manual.
Change a Subscription to Manual Payments via Database
To change a customer’s subscription via the database:
- Find the ID of the subscription – this will be displayed on the Manage Subscription table next to the subscription.
- Open MySQL editor (like PhpMyAdmin).
- Search the
wp_postmeta
table for a row where thepost_ID
is the ID found in step 1 and themeta_key
is'_requires_manual_renewal'
. - If a row is found, change the
meta_value
for that row totrue
. - If a row was not found in step 3, insert a row into the
wp_postmeta
table where thepost_ID
is the ID found in step 1, themeta_key
is'_requires_manual_renewal'
and themeta_value
istrue
.
You can also bulk insert or update this meta data via a custom MySQL query for a batch of subscription IDs.
Change a Subscription to Manual Payments via PHP
To change a customer’s subscription using PHP:
- Find the ID of the subscription – this will be displayed on the Manage Subscription table next to the subscription.
- In you PHP code, instantiate an instance of that subscription using
wcs_get_subscription( $subscription_id )
- Call
update_manual()
on the subscription instance with a value oftrue
to set the subscription to require manual renewals.