Change renewal time on subscription
-
I’m using Woo commerce with subscriptions, latest versions.
I’m trying to set a renewal time on a subscription to 11pm straight after its been created.
I keep getting an internal server errors and not so familiar with debugging them, $debug is set to true in wp-config.I’m using snippets to insert the action hook.
Is this the correct approach to this?
add_action( 'woocommerce_checkout_subscription_created', 'change_renewal_day', 10, 3 ); function change_renewal_day ($subscription, $order, $recurring_cart) { if($subscription->can_date_be_updated('next_payment')){ $newdate = new DateTime(strtotime($subscription->get_date('nextpayment'))); $newdate.settime(23,00); /* $subscription::update_dates( array('start' => $subscription::get_date('start'), 'trial_end'=>$subscription::get_date('trialend'), 'next_payment'=>$newdate->format('Y-m-d H:i:s'), 'last_payment'=>$subscription::get_date('last_payment') ) );*/ } }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Change renewal time on subscription’ is closed to new replies.