My client wants to remove "the next payment date" from woocommerce email.
Ive been looking for hours for a solution but i didnt
t find one. Is there any way to manipulate that data?
My client wants to remove "the next payment date" from woocommerce email.
Ive been looking for hours for a solution but i didnt
t find one. Is there any way to manipulate that data?
The basic subscription flow is that you can set your next subscription date like this -
add_action('woocommerce_thankyou', 'update_skip_next_payment_date', 20, 1);
function update_skip_next_payment_date($subscription) {
$date = new DateTime('2024-11-21');
$date->setTime(11, 59);
$subscription_next_payment_date = date_format($date, 'Y-m-d H:i:s'); // = '2021-05-28 08:55:00'
$new_dates = array(
'start' => $subscription->get_date('start'),
'trial_end' => $subscription->get_date('trial_end'),
'next_payment' => $subscription_next_payment_date,
'last_payment' => $subscription->get_date('last_payment'),
'end' => $subscription->get_date('end'),
);
$subscription->update_dates($new_dates);
}
So you can update the next subscription date here and set it next to the next subscription date here.
The reference URL is - How to set Next Payment date in Woocommerce Subscriptions?
The woocommerce subscription reference URL is - https://docs.woocommerce.com/document/subscriptions/develop/functions/#section-4):