Paypal | Site Banner Q4 2024

Added by Latoya

Product Icon

WooCommerce Subscriptions

Let customers subscribe to your products or services and pay on a weekly, monthly or annual basis.

You need to add break to your switch statements

— a/penselaranja/wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php
+++ b/penselaranja/wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/class-wc-subscription.php
@@ -2437,6 +2437,7 @@ class WC_Subscription extends WC_Order {
// translators: %s: date type (e.g. “end”).
$messages[] = sprintf( __( ‘The %s date must occur after the cancellation date.’, ‘woocommerce-subscriptions’ ), $date_type );
}
+ break;

case ‘cancelled’:
if ( array_key_exists( ‘last_order_date_created’, $timestamps ) && $timestamp < $timestamps['last_order_date_created'] ) {
@@ -2448,17 +2449,20 @@ class WC_Subscription extends WC_Order {
// translators: %s: date type (e.g. "end").
$messages[] = sprintf( __( 'The %s date must occur after the next payment date.', 'woocommerce-subscriptions' ), $date_type );
}
+ break;
case 'next_payment':
// Guarantees that end is strictly after trial_end, because if next_payment and end can't be at same time
if ( array_key_exists( 'trial_end', $timestamps ) && $timestamp < $timestamps['trial_end'] ) {
// translators: %s: date type (e.g. "end").
$messages[] = sprintf( __( 'The %s date must occur after the trial end date.', 'woocommerce-subscriptions' ), $date_type );
}
+ break;
case 'trial_end':
if ( ! in_array( $date_type, array( 'end', 'cancelled' ) ) && $timestamp <= $timestamps['start'] ) {
// translators: %s: date type (e.g. "next_payment").
$messages[] = sprintf( __( 'The %s date must occur after the start date.', 'woocommerce-subscriptions' ), $date_type );
}
+ break;
}

$dates[ $date_type ] = gmdate( 'Y-m-d H:i:s', $timestamp );

Author

eider570131d4f8

Current Status

Open

Last updated: April 10, 2023

0 comments

Log in to comment on this feature request.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.