• Resolved weebuns

    (@weebuns)


    Woocommerce has now made Eircodes a mandatory field in the checkout process. Eircodes are Ireland’s version of a Zip code or a UK post code.

    Unfortunately most Irish people don’t know their Eircode so and even thought the form shows it as optional you cannot proceed to place an order without this.

    In a previous forum post it was suggested to add the following code into the themes functions.php file but this did not work for me.

    Any thoughts anybody?

    add_filter( 'woocommerce_checkout_fields', 'custom_override_default_address_fields' );
    function custom_override_default_address_fields($fields){
        global $woocommerce;
        $country = $woocommerce->customer->get_country();
        if($country == 'IE'){
            $fields['billing']['postcode']['required'] = false;
            $fields['shipping']['postcode']['required'] = false;
        }
        return $fields;
    }
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hi @weebuns,

    Cross testing for you today on installs which have WordPress v5.1 and WooCommerce v3.5.5 installed which are the latest versions the Eircode field is optional and by default is not a mandatory field.

    Image Link: https://cloudup.com/iInoqgcTgqm

    I also tested by processing an order with no data added to the Eircode field and the order processed successfully.

    Image Link: https://cloudup.com/c1fVo7v064v

    Thread Starter weebuns

    (@weebuns)

    Hi Stuart,

    Thanks for looking at this. That’s very strange, our site is also on 3.5.5 and WP is up to date. I wonder what could be the issue.

    Our site is http://www.thecityseamstress.com.

    Nigel

    Thread Starter weebuns

    (@weebuns)

    Also, the site does show it as optional, but as you can see below it shows an error

    https://postimg.cc/TLPKBrNt

    Could it be required by your payment gateway? Temporarily enable the BACS payment gateway and see if you still have the problem.

    Thread Starter weebuns

    (@weebuns)

    It shouldn’t do. When I enabled Cash it gave the same issue.

    Luminus Alabi

    (@luminus)

    Automattic Happiness Engineer

    Hi @weebuns,

    As @stuartduff mentioned, Eircode is definitely not a required field, so you either have custom code that is setting it to required, your theme is responsible for it, or you have a plugin that is doing so.
     
    The best way to get to the root of this is to:
     

    • Temporarily switch your theme to Storefront
    • Disable all plugins except for WooCommerce
    • Repeat the action that is causing the problem

    If you’re not seeing the same problem after completing the conflict test, then you know the problem was with the plugins and/or theme you deactivated. To figure out which plugin is causing the problem, reactivate your other plugins one by one, testing after each one until you find the one causing the conflict. You can find a more detailed explanation on how to do a conflict test here.

    Thread Starter weebuns

    (@weebuns)

    Folks, thanks for the pointers and advice.

    It seemed to be down to the plugin “WC Fields Factory” which was causing the issue.

    Luminus Alabi

    (@luminus)

    Automattic Happiness Engineer

    Hi @weebuns,

    Glad to hear that you’ve figured out the root cause and can now reach out to the developers of the WC Fields Factory plugin for assistance.

    I’ll go ahead and mark this thread as resolved now.

    Cheers.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Eircode’ is closed to new replies.