Delete / remove details in the Checkout WooCommerce (Postal Code, Company, Phone ...)

WooCommerce is a very simple system for anyone who wants to create one shop, Based on WordPress.
The default installation, WooCommerce will add a standard form for billing details. On the "Checkout" customer.
Designed as a system shop allowing both physical delivery of products and downloading some virtual WooCommerce required in standard form a series of customer data: Name, Last Name, Telephone Number, Country, Address, City, Postal code. Some of these fields we need for a virtual command for example. A product that can be downloaded or product that was paid by PayPal would not need the data for delivery. In this case it is best to ease the control system for the user, by removing fields of Checkout.

Eliminating field "Zip Code" from WooCommerce Checkout

We can remove the "Postcode Billing Postcode" from WooCommerce, we must go and edit the functions.php file of the WordPress theme that is active on the website. In functions.php add the lines:

[Php]

add_filter ('woocommerce_checkout_fields', 'custom_override_checkout_fields');

function custom_override_checkout_fields ($ fields) {

unset ($ fields [ 'billing'] [ 'billing_postcode']);

return $ fields;

}

[/ Php]

Where "billing_postcode" is the field for the postcode. If you want to eliminate the second address field, we replace "billing_postcode" with "billing_address_2".

[Php] unset ($ fields [ 'billing'] [ 'billing_address_2']); [/ php]

There are situations that might not interest any details of customer's payment. Usually when payment is made through PayPal. In this scenario we can choose to eliminate all fields of the order page.

[Php]

add_filter ('woocommerce_checkout_fields', 'custom_override_checkout_fields');
function custom_override_checkout_fields ($ fields) {
unset ($ fields [ 'billing'] [ 'billing_postcode']);
unset ($ fields [ 'billing'] [ 'billing_country']);
unset ($ fields [ 'billing'] [ 'billing_state']);
unset ($ fields [ 'billing'] [ 'billing_phone']);
unset ($ fields [ 'order'] [ 'order_comments']);
unset ($ fields [ 'billing'] [ 'billing_address_2']);
unset ($ fields [ 'billing'] [ 'billing_postcode']);
unset ($ fields [ 'billing'] [ 'billing_company']);
unset ($ fields [ 'billing'] [ 'billing_last_name']);
unset ($ fields [ 'billing'] [ 'billing_email']);
unset ($ fields [ 'billing'] [ 'billing_city']);
return $ fields;
}

[/ Php]

This way you will delete all fields of the WooCommerce Checkout.

Delete / remove details in the Checkout WooCommerce (Postal Code, Company, Phone ...)

About the author

Stealth

Passionate about everything that means gadgets and IT, I write with pleasure stealthsettings.com from 2006 and I like to discover with you new things about computers and operating systems macOS, Linux, Windows, iOS and Android.

3 Comments

  • Bonjour Merci for the post!
    J'avais besoin de supprimer le nom de l'entreprise et c'est parfait ca fonctionne !!
    This is a supprimer également le nom de l'entreprise sur "expédier à une adresse différente".
    it is not the same way as the remplacement of custom_override_checkout_fields in the code. Pourriez vous m'aider?

  • Hi, I added this code to functions.php as guided but my website crashed. It's totally blank. I'm not totally new to stuff like this but I'm not a for either.

    If i could access my dashboard, i would just erase it but i can not access anything on my website at all.

    Please help, what should i do? Urgent response needed please!

  • Hello there
    We take a look at the "figura bilgileri" yazısın "teslimat adresi" olarak değiştirmek istiyorum. Not yapabiliriz.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment is processed.