mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Fix fatal error in the PPXO compat. layer when subscriptions is disabled
This commit is contained in:
parent
6bbc38954d
commit
28ce801eaf
1 changed files with 17 additions and 14 deletions
|
@ -148,6 +148,8 @@ class SubscriptionsHandler {
|
|||
return true;
|
||||
}
|
||||
|
||||
// Checks that require Subscriptions.
|
||||
if ( class_exists( \WC_Subscriptions::class ) ) {
|
||||
// My Account > Subscriptions > (Subscription).
|
||||
if ( wcs_is_view_subscription_page() ) {
|
||||
$subscription = wcs_get_subscription( absint( get_query_var( 'view-subscription' ) ) );
|
||||
|
@ -168,6 +170,7 @@ class SubscriptionsHandler {
|
|||
|
||||
return ( $subscription && PPECHelper::PPEC_GATEWAY_ID === $subscription->get_payment_method() );
|
||||
}
|
||||
}
|
||||
|
||||
// Admin-only from here onwards.
|
||||
if ( ! is_admin() ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue