mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Ensuse wc customer exist before using it
This commit is contained in:
parent
2c13266e8c
commit
cdc02f1c38
1 changed files with 4 additions and 0 deletions
|
@ -69,6 +69,10 @@ class LocalAlternativePaymentMethodsModule implements ModuleInterface {
|
|||
}
|
||||
|
||||
if ( ! is_admin() ) {
|
||||
if ( ! isset( WC()->customer ) ) {
|
||||
return $methods;
|
||||
}
|
||||
|
||||
$customer_country = WC()->customer->get_billing_country() ?: WC()->customer->get_shipping_country();
|
||||
$site_currency = get_woocommerce_currency();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue