Home › Forums › WoodMart support forum › billing_address_1 always required field BUG
billing_address_1 always required field BUG
- This topic has 12 replies, 2 voices, and was last updated 8 months, 2 weeks ago by Hung Pham.
-
AuthorPosts
-
March 22, 2024 at 1:24 am #551269
FreeRiderNSKParticipantHello!
billing_address_1 always required field (please check video)
I disabled all plugins. Deleted the entire code from file function.php.
Anyway, this field is always required (((
I tried to hide it using the function.php hook
I disabled the layouts to check…I tried all the options and can’t find the problem.
Strange behavior. If you disable the “country” field it works fine…March 23, 2024 at 4:18 am #551577
Hung PhamKeymasterHi FreeRiderNSK,
Thanks for reaching to us and take our apologies for the long delay in answering due to the weekend.
I conducted a test on my end with exact custom checkout layout and Checkout fields manager is still working fine https://prnt.sc/ie58EKsrZAzF https://prnt.sc/kKA6yOeFIiHL
You should deactivate all plugins (except Required Plugins) and then reactivate them one by one. This makes it very easy to isolate the plugin causing problems.
Regards,
March 23, 2024 at 12:49 pm #551652
FreeRiderNSKParticipantHello!
I disabled all plugins. I left only WooCommerce, Woodmart Core, WPBakery Page Builder.
The problem is not solved. Please help.
Check videoMarch 23, 2024 at 12:57 pm #551653
FreeRiderNSKParticipanton the /checkout/ page I found the following code. It overrides forcibly. It’s not just me who has the problem. Could this be a woocommerce plugin update?
https://github.com/woocommerce/woocommerce/issues/18425<script type="text/javascript" id="wc-address-i18n-js-extra"> /* <![CDATA[ */ var wc_address_i18n_params = {"locale":"{\"default\":{\"first_name\":{\"label\":\"\\u0418\\u043c\\u044f\",\"required\":true,\"autocomplete\":\"given-name\"},\"last_name\":{\"label\":\"\\u0424\\u0430\\u043c\\u0438\\u043b\\u0438\\u044f\",\"required\":true,\"autocomplete\":\"family-name\"},\"company\":{\"label\":\"\\u041d\\u0430\\u0437\\u0432\\u0430\\u043d\\u0438\\u0435 \\u043a\\u043e\\u043c\\u043f\\u0430\\u043d\\u0438\\u0438\",\"autocomplete\":\"organization\",\"required\":false},\"country\":{\"type\":\"country\",\"label\":\"\\u0421\\u0442\\u0440\\u0430\\u043d\\u0430\\\/\\u0440\\u0435\\u0433\\u0438\\u043e\\u043d\",\"required\":true,\"autocomplete\":\"country\"},\"address_1\":{\"label\":\"\\u0410\\u0434\\u0440\\u0435\\u0441\",\"placeholder\":\"\\u041d\\u043e\\u043c\\u0435\\u0440 \\u0434\\u043e\\u043c\\u0430 \\u0438 \\u043d\\u0430\\u0437\\u0432\\u0430\\u043d\\u0438\\u0435 \\u0443\\u043b\\u0438\\u0446\\u044b\",\"required\":true,\"autocomplete\":\"address-line1\"},\"city\":{\"label\":\"\\u041d\\u0430\\u0441\\u0435\\u043b\\u0451\\u043d\\u043d\\u044b\\u0439 \\u043f\\u0443\\u043d\\u043a\\u0442\",\"required\":true,\"autocomplete\":\"address-level2\"},\"state\":{\"type\":\"state\",\"label\":\"\\u041e\\u0431\\u043b\\u0430\\u0441\\u0442\\u044c \\\/ \\u0440\\u0430\\u0439\\u043e\\u043d\",\"required\":true,\"validate\":[\"state\"],\"autocomplete\":\"address-level1\"},\"postcode\":{\"label\":\"\\u041f\\u043e\\u0447\\u0442\\u043e\\u0432\\u044b\\u0439 \\u0438\\u043d\\u0434\\u0435\\u043a\\u0441\",\"required\":true,\"validate\":[\"postcode\"],\"autocomplete\":\"postal-code\"},\"0\":\"first_name\",\"1\":\"last_name\",\"2\":\"company\",\"3\":\"address_1\",\"4\":\"address_2\",\"5\":\"country\",\"6\":\"city\",\"7\":\"state\",\"8\":\"postcode\",\"9\":\"phone\"},\"RU\":{\"first_name\":{\"label\":\"\\u0418\\u043c\\u044f\",\"required\":true,\"autocomplete\":\"given-name\"},\"last_name\":{\"label\":\"\\u0424\\u0430\\u043c\\u0438\\u043b\\u0438\\u044f\",\"required\":true,\"autocomplete\":\"family-name\"},\"company\":{\"label\":\"\\u041d\\u0430\\u0437\\u0432\\u0430\\u043d\\u0438\\u0435 \\u043a\\u043e\\u043c\\u043f\\u0430\\u043d\\u0438\\u0438\",\"autocomplete\":\"organization\",\"required\":false},\"country\":{\"type\":\"country\",\"label\":\"\\u0421\\u0442\\u0440\\u0430\\u043d\\u0430\\\/\\u0440\\u0435\\u0433\\u0438\\u043e\\u043d\",\"required\":true,\"autocomplete\":\"country\"},\"address_1\":{\"label\":\"\\u0410\\u0434\\u0440\\u0435\\u0441\",\"placeholder\":\"\\u041d\\u043e\\u043c\\u0435\\u0440 \\u0434\\u043e\\u043c\\u0430 \\u0438 \\u043d\\u0430\\u0437\\u0432\\u0430\\u043d\\u0438\\u0435 \\u0443\\u043b\\u0438\\u0446\\u044b\",\"required\":true,\"autocomplete\":\"address-line1\"},\"city\":{\"label\":\"\\u041d\\u0430\\u0441\\u0435\\u043b\\u0451\\u043d\\u043d\\u044b\\u0439 \\u043f\\u0443\\u043d\\u043a\\u0442\",\"required\":true,\"autocomplete\":\"address-level2\"},\"state\":{\"type\":\"state\",\"label\":\"\\u041e\\u0431\\u043b\\u0430\\u0441\\u0442\\u044c \\\/ \\u0440\\u0430\\u0439\\u043e\\u043d\",\"required\":true,\"validate\":[\"state\"],\"autocomplete\":\"address-level1\"},\"postcode\":{\"label\":\"\\u041f\\u043e\\u0447\\u0442\\u043e\\u0432\\u044b\\u0439 \\u0438\\u043d\\u0434\\u0435\\u043a\\u0441\",\"required\":true,\"validate\":[\"postcode\"],\"autocomplete\":\"postal-code\"},\"0\":\"first_name\",\"1\":\"last_name\",\"2\":\"company\",\"3\":\"address_1\",\"4\":\"address_2\",\"5\":\"country\",\"6\":\"city\",\"7\":\"state\",\"8\":\"postcode\",\"9\":\"phone\"}}","locale_fields":"{\"address_1\":\"#billing_address_1_field, #shipping_address_1_field\",\"address_2\":\"#billing_address_2_field, #shipping_address_2_field\",\"state\":\"#billing_state_field, #shipping_state_field, #calc_shipping_state_field\",\"postcode\":\"#billing_postcode_field, #shipping_postcode_field, #calc_shipping_postcode_field\",\"city\":\"#billing_city_field, #shipping_city_field, #calc_shipping_city_field\"}","i18n_required_text":"\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e","i18n_optional_text":"\u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e"}; /* ]]> */ </script>
March 23, 2024 at 1:05 pm #551654
FreeRiderNSKParticipantI tried the default Twenty Twenty-Four theme.
function.php code:
add_filter( 'woocommerce_checkout_fields', 'bbloomer_required_woo_checkout_fields' ); function bbloomer_required_woo_checkout_fields( $fields ) { $fields['billing']['billing_address_1']['required'] = false; $fields['billing']['billing_city']['required'] = false; return $fields; }
I receive a code like this on the checkout page.
<script id="wc-address-i18n-js-extra"> var wc_address_i18n_params = {"locale":"{\"default\":{\"first_name\":{\"label\":\"\\u0418\\u043c\\u044f\",\"required\":true,\"class\":[\"form-row-first\"],\"autocomplete\":\"given-name\",\"priority\":10},\"last_name\":{\"label\":\"\\u0424\\u0430\\u043c\\u0438\\u043b\\u0438\\u044f\",\"required\":true,\"class\":[\"form-row-last\"],\"autocomplete\":\"family-name\",\"priority\":20},\"company\":{\"label\":\"\\u041d\\u0430\\u0437\\u0432\\u0430\\u043d\\u0438\\u0435 \\u043a\\u043e\\u043c\\u043f\\u0430\\u043d\\u0438\\u0438\",\"class\":[\"form-row-wide\"],\"autocomplete\":\"organization\",\"priority\":30,\"required\":false},\"country\":{\"type\":\"country\",\"label\":\"\\u0421\\u0442\\u0440\\u0430\\u043d\\u0430\\\/\\u0440\\u0435\\u0433\\u0438\\u043e\\u043d\",\"required\":true,\"class\":[\"form-row-wide\",\"address-field\",\"update_totals_on_change\"],\"autocomplete\":\"country\",\"priority\":40},\"address_1\":{\"label\":\"\\u0410\\u0434\\u0440\\u0435\\u0441\",\"placeholder\":\"\\u041d\\u043e\\u043c\\u0435\\u0440 \\u0434\\u043e\\u043c\\u0430 \\u0438 \\u043d\\u0430\\u0437\\u0432\\u0430\\u043d\\u0438\\u0435 \\u0443\\u043b\\u0438\\u0446\\u044b\",\"required\":true,\"class\":[\"form-row-wide\",\"address-field\"],\"autocomplete\":\"address-line1\",\"priority\":50},\"city\":{\"label\":\"\\u041d\\u0430\\u0441\\u0435\\u043b\\u0451\\u043d\\u043d\\u044b\\u0439 \\u043f\\u0443\\u043d\\u043a\\u0442\",\"required\":true,\"class\":[\"form-row-wide\",\"address-field\"],\"autocomplete\":\"address-level2\",\"priority\":70},\"state\":{\"type\":\"state\",\"label\":\"\\u041e\\u0431\\u043b\\u0430\\u0441\\u0442\\u044c \\\/ \\u0440\\u0430\\u0439\\u043e\\u043d\",\"required\":true,\"class\":[\"form-row-wide\",\"address-field\"],\"validate\":[\"state\"],\"autocomplete\":\"address-level1\",\"priority\":80},\"postcode\":{\"label\":\"\\u041f\\u043e\\u0447\\u0442\\u043e\\u0432\\u044b\\u0439 \\u0438\\u043d\\u0434\\u0435\\u043a\\u0441\",\"required\":true,\"class\":[\"form-row-wide\",\"address-field\"],\"validate\":[\"postcode\"],\"autocomplete\":\"postal-code\",\"priority\":90},\"0\":\"first_name\",\"1\":\"last_name\",\"2\":\"company\",\"3\":\"address_1\",\"4\":\"address_2\",\"5\":\"country\",\"6\":\"city\",\"7\":\"state\",\"8\":\"postcode\",\"9\":\"phone\"},\"RU\":{\"first_name\":{\"label\":\"\\u0418\\u043c\\u044f\",\"required\":true,\"class\":[\"form-row-first\"],\"autocomplete\":\"given-name\",\"priority\":10},\"last_name\":{\"label\":\"\\u0424\\u0430\\u043c\\u0438\\u043b\\u0438\\u044f\",\"required\":true,\"class\":[\"form-row-last\"],\"autocomplete\":\"family-name\",\"priority\":20},\"company\":{\"label\":\"\\u041d\\u0430\\u0437\\u0432\\u0430\\u043d\\u0438\\u0435 \\u043a\\u043e\\u043c\\u043f\\u0430\\u043d\\u0438\\u0438\",\"class\":[\"form-row-wide\"],\"autocomplete\":\"organization\",\"priority\":30,\"required\":false},\"country\":{\"type\":\"country\",\"label\":\"\\u0421\\u0442\\u0440\\u0430\\u043d\\u0430\\\/\\u0440\\u0435\\u0433\\u0438\\u043e\\u043d\",\"required\":true,\"class\":[\"form-row-wide\",\"address-field\",\"update_totals_on_change\"],\"autocomplete\":\"country\",\"priority\":40},\"address_1\":{\"label\":\"\\u0410\\u0434\\u0440\\u0435\\u0441\",\"placeholder\":\"\\u041d\\u043e\\u043c\\u0435\\u0440 \\u0434\\u043e\\u043c\\u0430 \\u0438 \\u043d\\u0430\\u0437\\u0432\\u0430\\u043d\\u0438\\u0435 \\u0443\\u043b\\u0438\\u0446\\u044b\",\"required\":true,\"class\":[\"form-row-wide\",\"address-field\"],\"autocomplete\":\"address-line1\",\"priority\":50},\"city\":{\"label\":\"\\u041d\\u0430\\u0441\\u0435\\u043b\\u0451\\u043d\\u043d\\u044b\\u0439 \\u043f\\u0443\\u043d\\u043a\\u0442\",\"required\":true,\"class\":[\"form-row-wide\",\"address-field\"],\"autocomplete\":\"address-level2\",\"priority\":70},\"state\":{\"type\":\"state\",\"label\":\"\\u041e\\u0431\\u043b\\u0430\\u0441\\u0442\\u044c \\\/ \\u0440\\u0430\\u0439\\u043e\\u043d\",\"required\":true,\"class\":[\"form-row-wide\",\"address-field\"],\"validate\":[\"state\"],\"autocomplete\":\"address-level1\",\"priority\":80},\"postcode\":{\"label\":\"\\u041f\\u043e\\u0447\\u0442\\u043e\\u0432\\u044b\\u0439 \\u0438\\u043d\\u0434\\u0435\\u043a\\u0441\",\"required\":true,\"class\":[\"form-row-wide\",\"address-field\"],\"validate\":[\"postcode\"],\"autocomplete\":\"postal-code\",\"priority\":90},\"0\":\"first_name\",\"1\":\"last_name\",\"2\":\"company\",\"3\":\"address_1\",\"4\":\"address_2\",\"5\":\"country\",\"6\":\"city\",\"7\":\"state\",\"8\":\"postcode\",\"9\":\"phone\"}}","locale_fields":"{\"address_1\":\"#billing_address_1_field, #shipping_address_1_field\",\"address_2\":\"#billing_address_2_field, #shipping_address_2_field\",\"state\":\"#billing_state_field, #shipping_state_field, #calc_shipping_state_field\",\"postcode\":\"#billing_postcode_field, #shipping_postcode_field, #calc_shipping_postcode_field\",\"city\":\"#billing_city_field, #shipping_city_field, #calc_shipping_city_field\"}","i18n_required_text":"\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e","i18n_optional_text":"\u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e"}; </script>
The script again forcibly changes the fields
March 23, 2024 at 2:00 pm #551691
Hung PhamKeymasterHi FreeRiderNSK,
Please update WooCommerce to the latest version and check again.
I kindly recommend that you take a complete backup of your site before proceeding.
Regards,
March 23, 2024 at 2:19 pm #551698
FreeRiderNSKParticipantI renewed. The problem has not been solved! ((((
March 23, 2024 at 2:22 pm #551700
FreeRiderNSKParticipantCan you check the problem normally? We’re just texting and guessing. Why guess? Can you help me decide? Find the problem?
March 23, 2024 at 2:37 pm #551705
FreeRiderNSKParticipantPS All updates appled (tools->patcher)…
March 25, 2024 at 7:26 am #551875
Hung PhamKeymasterHi FreeRiderNSK,
First of all, take my apologies for the delay in answering because of the weekend.
I’ve passed this topic to one of our developers, and I will let you know once get an answer.
Thanks for your patience.
Regards,
March 25, 2024 at 10:49 am #551921
Hung PhamKeymasterHi FreeRiderNSK,
I’ve fixed your issue. Please check your site again.
Regards,
March 26, 2024 at 12:12 pm #552289
FreeRiderNSKParticipantHello! It looks like the problem has been resolved. Please tell me what it was? So that I know why the error occurred and can fix it myself…
March 26, 2024 at 1:06 pm #552333
Hung PhamKeymasterHi FreeRiderNSK,
I have an assumption that when you changed the country of residence, something went wrong.
Regards,
-
AuthorPosts
- You must be logged in to create new topics. Login / Register