Modify WooCommerce Checkout Fields

Customizes the WooCommerce checkout fields. (Here we are removing the billing company field, and making the billing phone number not required.

PHP

function custom_override_checkout_fields($fields) {
    unset($fields['billing']['billing_company']);
    $fields['billing']['billing_phone']['required'] = false;
    return $fields;
}
add_filter('woocommerce_checkout_fields', 'custom_override_checkout_fields');

Snippet Feedback

Did this snippet work for you? Do you have any questions about this snippet? Leave some feedback below.

9 Views

Tags

Language

Did it work?

Save Snippet

Embed Snippet

To embed this snippet on your site, copy this html code and paste into your webpage. Learn more
By embedding snippets on your site, you are agreeing to our terms and conditions.

Embed Snippet

To embed this snippet on your site, copy this html code and paste into your webpage. Learn more
By embedding snippets on your site, you are agreeing to our terms and conditions.

Embed Snippet

To embed this snippet on your site, copy this html code and paste into your webpage. Learn more
By embedding snippets on your site, you are agreeing to our terms and conditions.