• On the woocommerce checkout page, both the dutch fields and the original fields are shown:

    Dutch fields:
    billing_street_name
    billing_house_number_field
    billing_house_number_field_suffix

    Original fields:
    billing_address_1_field
    billing_address_2_field

    The expected behavior is that the original fields are hidden. This is indeed the case when re-selecting the country.

    • This topic was modified 6 years, 3 months ago by roelleor.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Same problem here!
    Also the order of fields are incorrect.

    Plugin Author PostNL

    (@postnl)

    Hi @roelleor and @keraweb,

    Can you send an email to [email protected], it would be possible for me or my colleague to help you with this problem.

    Postnl snapt het hele open-source gedoe nog niet helemaal.
    Support is via deze pagina’s, niet via een e-mail adres.

    Verder ontgaat het me volledig waarom er in een soort Engels wordt geconverseerd, het is een specifiek Nederlandse plugin. Nederlands zou daarom de voertaal moeten zijn.

    Zal ik dan maar even antwoord geven:

    jQuery( document ).ready(function(){
        if (jQuery('#billing_country').val() == 'NL') {
            jQuery("#billing_address_1_field, #billing_address_2_field").hide();
        }
        else jQuery("#billing_address_1_field, #billing_address_2_field").show();
    });
    • This reply was modified 6 years, 3 months ago by rawsilk.
    Thread Starter roelleor

    (@roelleor)

    For a complete temporal fix solution (note: this does not fix the field order issue):
    add_action( 'wp_enqueue_scripts', ['my_enqueue_scripts'] );

    function my_enqueue_scripts()
        {
            if (is_checkout()) {
                wp_enqueue_script('mypostnlfix', '/path/to/postnlfix.js', [],
                    'my-version', true);
            }
        }

    and the script I modified a tiny bit from @rawsilk:

    jQuery(document).ready(function($) {
        try {
            if ($('#billing_country').val() == 'NL') {
                $("#billing_address_1_field, #billing_address_2_field").hide();
            }
            else $("#billing_address_1_field, #billing_address_2_field").show();
        } catch (e) {
            // pass
        }
    });
    • This reply was modified 6 years, 3 months ago by roelleor.

    @roelleor Yep, also don’t forget: #shipping_address_1_field #shipping_address_2_field as i did initially.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Bug: Original fields not hidden on page load on checkout page’ is closed to new replies.