Home Forums WoodMart support forum billing_address_1 always required field BUG

billing_address_1 always required field BUG

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #551269

    FreeRiderNSK
    Participant

    Hello!
    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…

    #551577

    Hung Pham
    Keymaster

    Hi 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,

    #551652

    FreeRiderNSK
    Participant

    Hello!
    I disabled all plugins. I left only WooCommerce, Woodmart Core, WPBakery Page Builder.
    The problem is not solved. Please help.
    Check video

    #551653

    FreeRiderNSK
    Participant

    on 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>
    #551654

    FreeRiderNSK
    Participant

    I 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

    #551691

    Hung Pham
    Keymaster

    Hi 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,

    #551698

    FreeRiderNSK
    Participant

    I renewed. The problem has not been solved! ((((

    #551700

    FreeRiderNSK
    Participant

    Can you check the problem normally? We’re just texting and guessing. Why guess? Can you help me decide? Find the problem?

    #551705

    FreeRiderNSK
    Participant

    PS All updates appled (tools->patcher)…

    #551875

    Hung Pham
    Keymaster

    Hi 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,

    #551921

    Hung Pham
    Keymaster

    Hi FreeRiderNSK,

    I’ve fixed your issue. Please check your site again.

    Regards,

    #552289

    FreeRiderNSK
    Participant

    Hello! 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…

    #552333

    Hung Pham
    Keymaster

    Hi FreeRiderNSK,

    I have an assumption that when you changed the country of residence, something went wrong.

    Regards,

Viewing 13 posts - 1 through 13 (of 13 total)