0

My client wants to remove "the next payment date" from woocommerce email.

Ive been looking for hours for a solution but i didntt find one. Is there any way to manipulate that data?

  • 1
    Welcome to Stack Overflow! Your question lacks information to get any help from [so] users. Please take the [tour], and read through the [help], learn  [ask] a good question? to maximize your chance to get answer to your questions. Include a [mcve] and people will be very glad to help you. – mujuonly Nov 21 '22 at 04:16
  • Please provide enough code so others can better understand or reproduce the problem. – Community Nov 21 '22 at 16:49

1 Answers1

1

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):

Rajeev Singh
  • 1,724
  • 1
  • 6
  • 23