Change fields order in checkout page
-
Hi, I am trying to change fields order in WooCommerce checkout page.
Firstly I has changed order with following code:add_filter('woocommerce_checkout_fields', 'custom_override_checkout_fields', 40); function custom_override_checkout_fields($fields) { $fields['billing']['billing_state']['priority'] = 21; $fields['billing']['billing_city']['priority'] = 22; $fields['billing']['billing_postcode']['priority'] = 61; unset($fields['billing']['billing_address_2']); unset($fields['shipping']); return $fields; }
After that I checked the source code of page and order was applied.
But I have understand after page load some JavaScript codes will change the fields order.
I found the wp-content/plugins/woocommerce/assets/js/frontend/address-i18n.min.js will do something which that change fields order.
I found above this script injection in source code a variable with name: wc_address_i18n_params which looks like this hold locale format of countries, But I found the value of this variable is not which I applied and confirmed in HTML source code.
I tried to deenqueue and deregister this script, But looks likes some other WooCommerce script need this script to run.
- The topic ‘Change fields order in checkout page’ is closed to new replies.