Billing Fields Added to Registration Form – State Not Updating
-
I have added the woocommerce billing fields to my registration form using the function and hook below:
function my_custom_function(){
global $woocommerce;
$checkout = $woocommerce->checkout();foreach ($checkout->checkout_fields[‘billing’] as $key => $field) :
if(!($key == ‘billing_first_name’ || $key == ‘billing_last_name’)){
$field[‘required’] = false;
}
if(!($key == ‘billing_email’)){
woocommerce_form_field( $key, $field, $checkout->get_value( $key ) );
}
endforeach;
}
add_action(‘woocommerce_register_form’,’my_custom_function’);the issue i have is the state is not updating when the country dropdown selection is changed. I assume there is JS i need to hook to the onchange event but i can’t find documentation on what that is. Can someone please help point me in the right direction without having to rebuild them all myself?
- The topic ‘Billing Fields Added to Registration Form – State Not Updating’ is closed to new replies.