A simple, powerful and independent e-commerce platform.
Sell anything with ease.

Change postcode/zipcode from required to optional

In some countries postcode/zipcode may be unavailable or not used. This code changes the postcode/zipcode fields from required to optional.

/**
* Disable postcode/zipcode requirement
*/

add_filter('woocommerce_checkout_fields' , 'cc_override_postcode_requirement');

function cc_override_postcode_requirement($fields) {

  $fields['billing']['billing_postcode']['required'] = false;
  $fields['shipping']['shipping_postcode']['required'] = false;
  return $fields;

}
View Raw Code ID: 968