Updating and Synchronizing Woocommerce Subscriptions to Custom Date
PHP Snippet 1:
function push_subscriptions_to_next_week($subscription, $order, $recurring_cart) {
// The new date calculation of +7 days is just an example
$new_dates = array(
'start' => date('Y-m-d H:i:s', strtotime('+7 days', time())),
'next_payment' => date('Y-m-d H:i:s', strtotime('+7 days', time()))
);
$subscription->update_dates($new_dates, 'site');
}
add_action( 'woocommerce_checkout_subscription_created', 'push_subscriptions_to_next_week', 10, 3);