WordPress.org

Support

Support » Plugins and Hacks » Impossible to make billing Postcode not required

Impossible to make billing Postcode not required

  • I need to make the Postcode field in Billing address NOT required, but it’s impossible. I tried code in functions.php, nothing happens. I bought the Custom Shipping Options plugin for $40. It allow to uncheck the fields which you dont want to be “required”. Works on all fields but the billing Postcode stays “required”. I’ve tried everything. It’s stuck required. How to make it unrequired?

    http://wordpress.org/plugins/woocommerce/

Viewing 7 replies - 1 through 7 (of 7 total)
  • 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;
    }

    No, stays on place.

    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;
    }
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Impossible to make billing Postcode not required’ is closed to new replies.