Fix undefined index on billing phone

This commit is contained in:
dinamiko 2022-08-08 15:48:36 +02:00
parent e65dab755a
commit b57567cf84

View file

@ -334,7 +334,7 @@ class PayUponInvoice {
);
$checkout_fields = WC()->checkout()->get_checkout_fields();
$checkout_phone_required = $checkout_fields['billing']['billing_phone']['required'];
$checkout_phone_required = $checkout_fields['billing']['billing_phone']['required'] ?? false;
if ( ! array_key_exists( 'billing_phone', $checkout_fields['billing'] ) || $checkout_phone_required === false ) {
woocommerce_form_field(
'billing_phone',