Ensuse wc customer exist before using it

This commit is contained in:
Emili Castells Guasch 2024-08-21 18:00:03 +02:00
parent 2c13266e8c
commit cdc02f1c38

View file

@ -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();