• Resolved TechMan

    (@techman)


    Is it possible to hide zip code field or at least make it optional? Hiding it would be much better though.

Viewing 3 replies - 1 through 3 (of 3 total)
  • arcangelini

    (@arcangelini)

    Hey @techman

    You can do this by either using some custom code that we have in our Customize checkout field documentation. Or by using our Checkout Field Editor extension.

    It is your choice as to which option would be better for you : )

    Thread Starter TechMan

    (@techman)

    Is the code to remove postcode correct?

    add_filter( 'woocommerce_default_address_fields' , 'custom_override_default_address_fields' );
    
    function custom_override_default_address_fields( $address_fields ) {
         unset($address_fields['postcode']);
    
         return $address_fields;
    }
    Plugin Support Aashik P – a11n

    (@aashik)

    Is the code to remove postcode correct?

    Tested the above snippet on my own local site to confirm that it indeed hides the zip code field in the checkout page:

    checkout page
    Link to image: https://d.pr/i/XNcTvG

    Just a heads up that if one of your plugins or payment gateways needs this data, then customers may not be able to successfully process orders on the store.

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

The topic ‘How to hide zip code field’ is closed to new replies.