Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: update

Hide bundled subscription management UI while preserving renewal processing functionality
6 changes: 4 additions & 2 deletions includes/class-wc-payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -2131,8 +2131,10 @@ public static function maybe_remove_stripe_billing_deprecation_note( $plugin ) {
* Update the Stripe Billing deprecation note.
*/
public static function maybe_update_stripe_billing_deprecation_note() {
// If Stripe Billing is not enabled or WooCommerce Subscriptions is active, do not update the note.
if ( ! WC_Payments_Features::is_stripe_billing_enabled() || class_exists( 'WC_Subscriptions' ) ) {
// If bundled subscriptions are not enabled or WooCommerce Subscriptions is active, do not update the note.
$has_bundled_subs = WC_Payments_Features::is_wcpay_subscriptions_enabled() || WC_Payments_Features::is_stripe_billing_enabled();

if ( ! $has_bundled_subs || class_exists( 'WC_Subscriptions' ) ) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,12 @@ public static function get_note() {
} elseif ( version_compare( $wcpay_version, '9.9.0', '<' ) ) {
$note->set_title( __( 'WooPayments subscriptions update', 'woocommerce-payments' ) );
$note->set_content( __( 'WooPayments no longer supports billing for existing customer subscriptions. All subscriptions data is read-only. Please install WooCommerce Subscriptions to continue managing your subscriptions.', 'woocommerce-payments' ) );
} else {
} elseif ( version_compare( $wcpay_version, '10.2.0', '<' ) ) {
$note->set_title( __( 'WooPayments subscriptions update', 'woocommerce-payments' ) );
$note->set_content( __( 'WooPayments no longer supports subscriptions capabilities and subscriptions data can no longer be accessed. Please install WooCommerce Subscriptions to continue managing your subscriptions.', 'woocommerce-payments' ) );
} else {
$note->set_title( __( 'Built-in subscriptions functionality has been removed. Here\'s what to do', 'woocommerce-payments' ) );
$note->set_content( __( 'To continue offering subscriptions and gain access to your data, please install WooCommerce Subscriptions. WooPayments no longer supports this feature.', 'woocommerce-payments' ) );
}

$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
Expand All @@ -82,6 +85,9 @@ public static function get_note() {
* @return bool
*/
protected static function is_bundled_subscriptions_enabled() {
return WC_Payments_Features::is_stripe_billing_enabled() && ! class_exists( 'WC_Subscriptions' );
$has_bundled_subs = WC_Payments_Features::is_wcpay_subscriptions_enabled() || WC_Payments_Features::is_stripe_billing_enabled();
$has_wc_subs = class_exists( 'WC_Subscriptions' );

return $has_bundled_subs && ! $has_wc_subs;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,15 @@ protected function get_wcpay_version() {
/**
* Check if bundled subscriptions are enabled.
*
* This checks for either WCPay Subscriptions or Stripe Billing being enabled,
* as both represent the bundled subscription functionality.
*
* @return bool
*/
protected function is_bundled_subscriptions_enabled() {
return WC_Payments_Features::is_stripe_billing_enabled() && ! class_exists( 'WC_Subscriptions' );
$has_bundled_subs = WC_Payments_Features::is_wcpay_subscriptions_enabled() || WC_Payments_Features::is_stripe_billing_enabled();
$has_wc_subs = class_exists( 'WC_Subscriptions' );

return $has_bundled_subs && ! $has_wc_subs;
}
}
Loading
Loading