Skip to content

Commit

Permalink
fix: undefined $cart_contains_subscription (#9893)
Browse files Browse the repository at this point in the history
  • Loading branch information
frosso authored Dec 6, 2024
1 parent 907c238 commit 007d6d6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions changelog/frosso-patch-1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

fix: undefined $cart_contains_subscription
11 changes: 6 additions & 5 deletions includes/class-wc-payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -1876,12 +1876,13 @@ public static function init_woopay() {
public static function load_stripe_bnpl_site_messaging() {
// The messaging element shall not be shown for subscription products.
// As we are not too deep into subscriptions API, we follow simplistic approach for now.
$is_subscription = false;
$are_subscriptions_enabled = class_exists( 'WC_Subscriptions' ) || class_exists( 'WC_Subscriptions_Core_Plugin' );
$is_subscription = false;
$cart_contains_subscription = false;
$are_subscriptions_enabled = class_exists( 'WC_Subscriptions' ) || class_exists( 'WC_Subscriptions_Core_Plugin' );
if ( $are_subscriptions_enabled ) {
global $product;
$is_subscription = $product && WC_Subscriptions_Product::is_subscription( $product );
$cart_contains_subscription = is_cart() && WC_Subscriptions_Cart::cart_contains_subscription();
global $product;
$is_subscription = $product && WC_Subscriptions_Product::is_subscription( $product );
$cart_contains_subscription = is_cart() && WC_Subscriptions_Cart::cart_contains_subscription();
}

if ( ! $is_subscription && ! $cart_contains_subscription ) {
Expand Down

0 comments on commit 007d6d6

Please sign in to comment.