Disable zipcode validation on checkout and shipping calculator on cart in WooCommerce

Disable zipcode validation on checkout and shipping calculator on the cart in WooCommerce on child sites.

Snippet Type

Execute on Child Sites

Snippet

add_filter( 'woocommerce_shipping_calculator_enable_postcode', '__return_false' );

add_filter( 'woocommerce_default_address_fields' , 'wc_disable_postcode_validation' );
 
function wc_disable_postcode_validation( $address_fields ) {
  $address_fields['postcode']['required'] = false;
  return $address_fields;
}
1 Like