Skip to content

Commit 5852018

Browse files
committed
Return boolean when cart has subscription with yith
1 parent 2f851a5 commit 5852018

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Features/Subscriptions/YithSubscriptionPluginHandler.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,15 +306,13 @@ public function get_subscription_payment_method_friendly_name( $subscription ) {
306306
* @return bool
307307
*/
308308
function cart_has_subscription() {
309-
// Ensure YITH WooCommerce Subscription plugin is active
309+
310310
if (!function_exists('YITH_WC_Subscription')) {
311311
return false;
312312
}
313313

314-
// Get the YITH_WC_Subscription instance
315314
$ywsbs = YITH_WC_Subscription();
316315

317-
// Use the is_subscription method to check if the product is a subscription
318-
return $ywsbs->cart_has_subscriptions();
316+
return is_string($ywsbs->cart_has_subscriptions());
319317
}
320318
}

0 commit comments

Comments
 (0)