Skip to content

Commit

Permalink
fixed-conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammaddanish-cedcoss committed Jul 31, 2024
1 parent 2db4525 commit 876748f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions public/class-subscriptions-for-woocommerce-public.php
Original file line number Diff line number Diff line change
Expand Up @@ -1205,6 +1205,25 @@ public function wps_sfw_woocommerce_order_status_changed( $order_id, $old_status
wps_sfw_update_meta_data( $order_id, 'wps_sfw_subscription_activated', 'yes' );
}
}
// Renewal order handling.
$renewal_order = wps_sfw_get_meta_data( $order_id, 'wps_sfw_renewal_order', true );
$subscription_id = wps_sfw_get_meta_data( $order_id, 'wps_sfw_subscription', true );
if ( $subscription_id && 'yes' == $renewal_order ) {
$current_time = apply_filters( 'wps_sfw_subs_curent_time', current_time( 'timestamp' ), $subscription_id );
$wps_susbcription_trial_end = wps_sfw_susbcription_trial_date( $subscription_id, $current_time );
$wps_next_payment_date = wps_sfw_next_payment_date( $subscription_id, $current_time, $wps_susbcription_trial_end );

$wps_next_payment_date = apply_filters( 'wps_sfw_next_payment_date', $wps_next_payment_date, $subscription_id );

wps_sfw_update_meta_data( $subscription_id, 'wps_next_payment_date', $wps_next_payment_date );
}
} elseif ( 'failed' == $new_status || 'pending' == $new_status || 'wps_renewal' == $new_status ) {
// Renewal order handling.
$subscription_id = wps_sfw_get_meta_data( $order_id, 'wps_sfw_subscription', true );
$renewal_order = wps_sfw_get_meta_data( $order_id, 'wps_sfw_renewal_order', true );
if ( $subscription_id && 'yes' == $renewal_order ) {
wps_sfw_update_meta_data( $subscription_id, 'wps_subscription_status', 'on-hold' );
}
}
}
}
Expand Down

0 comments on commit 876748f

Please sign in to comment.