In Woocommerce checkout, I am adding a custom checkout field and here is my code:
add_action( 'woocommerce_before_order_notes', 'shipping_add_select_checkout_field' );
function shipping_add_select_checkout_field( WC_Checkout $checkout ) {
$options = array_merge( [ '' => __( 'Nothing to select' ), ], city_zone() );
woocommerce_form_field( 'billing_country_zone', array(
'type' => 'select',
'class' => array( 'form-row-wide', 'address-field', 'update_totals_on_change' ),
'label' => __( 'City zone' ),
'required' => true,
'options' => $options
), WC()->customer->billing_country_zone );
}
Now I am totally lost as I need to know what is WC()->customer->billing_country_zone
for and how can I check it's value…
Any help is really appreciated.