mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-05-02 12:02:25 +08:00
https://stackoverflow.com/questions/51657296/remove-postcode-from-woocommerce-cart-shipping-calculator/ https://njengah.com/woocommerce-disable-postcodezip-validation-checkout/
8 lines
313 B
Text
8 lines
313 B
Text
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;
|
|
}
|