Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Commit 8f8cda8

Browse files
committed
Handle reactivation correctly.
1 parent 9c5284d commit 8f8cda8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

includes/class-wcs-action-scheduler-customer-notifications.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ public function __construct() {
4343

4444
public function set_date_types_to_schedule() {
4545
$date_types_to_schedule = wcs_get_subscription_date_types();
46-
unset( $date_types_to_schedule['start'] );
46+
unset(
47+
$date_types_to_schedule['start'],
48+
$date_types_to_schedule['cancelled'] // prevent scheduling end date when reactivating subscription.
49+
);
4750

4851
//TODO: filter?
4952
$this->date_types_to_schedule = array_keys( $date_types_to_schedule );
@@ -53,7 +56,7 @@ protected function schedule_notification( $subscription, $action, $timestamp ) {
5356
if (
5457
! (
5558
$subscription->has_status( 'active' )
56-
|| $subscription->has_status( 'pending-cancelled' ) //TODO: do we want to create notifications when user cancelled the subscription?
59+
|| $subscription->has_status( 'pending-cancel' ) //TODO: do we want to create notifications when user cancelled the subscription?
5760
)
5861
) {
5962
return;

0 commit comments

Comments
 (0)