0

I was recently working on shipping methods in woocommerce that allows customers to pay for a specific shipping fee based on their location. But, during checkout when the country (Nigeria) is selected, post/zip code field disappears. Went ahead to choose a different country and the post/zip code field appears.

please, I’ll like to display zip code options during checkout, how do I get this done? I’m so confused. Thank you.

0

The postcode field was hidden for Nigeria in 3.5, you can see the reasoning given here: https://github.com/woocommerce/woocommerce/issues/21055

While the Nigeria Postal Service (http://nipost.gov.ng/) introduced Postal Codes a few years ago, they aren't being used by hardly anyone.

Nobody knows their postal codes as the implementation is very convoluted and nothing was done to sensitize the public or encourage their use. You won't find them on any addresses and they aren't required for finding a building/location or for delivering parcels.

If this is incorrect, you should file an issue.

To change this behaviour on one site, though, you can use filter woocommerce_get_country_locale, like so:

add_filter(
    'woocommerce_get_country_locale',
    function( $locales ) {
        $locales['NG']['postcode']['hidden'] = false;

        return $locales;
    }
);
| improve this answer | |
  • Thank you so much.. – Sir O Tee Apr 20 at 17:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.