Thread Starter
ponch
(@ponch)
I am using this plugin. It’s impossible to remove “required” mark from “billing postcode”. Try yourself. It just stays in place.
…then you have to create a hook
there are a example Make phone number not required
I’m not a programmer, I guess it could be …
//Hock
add_filter( 'woocommerce_billing_fields', 'billing_postcode' );
function billing_postcode( $address_fields ) {
$address_fields['billing_postcode']['required'] = false;
return $address_fields;
}
Thread Starter
ponch
(@ponch)
I tried this code in functions.php + in plugin Customize Checkout Options (paid $40 for it) the “required” field for Billing Zipcode is unchecked + I erased update_totals_on_change in Postcode options, still it has red mark and is required.
Anyone can explain why?
I’m using to methods of delivery – all the country and local.
I disabled shipping fields and use billing as the address. Locals dont need and dont remember their postcode, so I need to make it non-required. But cant.
…the hook has to go in the functions.php file of the theme
I’ve tried it and the red mark disappears
You need to use woocommerce_default_address_fields for the postcode.
//Hock
add_filter( 'woocommerce_default_address_fields', 'billing_postcode' );
function billing_postcode( $address_fields ) {
$address_fields['billing_postcode']['required'] = false;
return $address_fields;
}