Pro Verified

Name

Deactivate some WooCommerce Checkout Fields

About

Deactivate some WooCommerce Checkout Fields from showing

Language

Javascript

Rating

Voted: 10 by 14 user(s)

How to Setup Snippet

Add to Code Snippets to Run Everywhere. Any items that are active (and do not sit within /* and */ comments) will not be shown on the Checkout Page.

Codevault

WebSquadron

Scroll down to see more snippets from this codevault.

Wordpress Compatability

The author has indicated that this snippet is compatable up to wordpress version: Not Specified

Code Snippet Plugin Sync

Free & Pro

Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.

Pro Only (Coming Soon)

You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.

History

Last modified:

30/06/2024

Important Note

This snippet has the following status:

Pro Verified

This snippet has been verified by a Code Snippet Pro team member.

Pro Comments:

Deactivate some WooCommerce Checkout Fields

 
                    
1/* WooCommerce: The Code Below Removes Checkout Fields */
2add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
3function custom_override_checkout_fields( $fields ) {
4/*unset($fields['billing']['billing_first_name']);*/
5/*unset($fields['billing']['billing_last_name']);*/
6unset($fields['billing']['billing_company']);
7/*unset($fields['billing']['billing_address_1']);
8unset($fields['billing']['billing_address_2']);
9unset($fields['billing']['billing_city']);
10unset($fields['billing']['billing_postcode']);
11unset($fields['billing']['billing_country']);
12unset($fields['billing']['billing_state']);
13unset($fields['billing']['billing_phone']);*/
14unset($fields['order']['order_comments']);
15/*unset($fields['billing']['billing_email']);*/
16/*unset($fields['account']['account_username']);*/
17/*unset($fields['account']['account_password']);*/
18/*unset($fields['account']['account_password-2']);*/
19return $fields;
20}

10

Featured Snippet

Comments

  • HN

    1 year ago

    I know this comment might come as off one, but please also write how to do guide also. Might get very helpful. 

Related Snippets

Please see some snippets below related to this snippet..

WooCommerce

AI Verified

0

Hide Payment Gateways Based on Cart Total

Added: 1 year ago

Last Updated: 1 year ago

WooCommerce

AI Verified

0

Remove the product description title

Added: 1 year ago

Last Updated: 1 year ago

WooCommerce

AI Verified

0

Automatically add coupon codes to shopping cart for offers

Added: 1 year ago

Last Updated: 1 year ago

The more user-friendly your store is, the more orders you will get. So why should your customers have to manually enter a coupon code you offer? It is much better to add the code automatically when th...

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

Performance

AI Verified

33

Remove Unused Javascript

Added: 1 year ago

Last Updated: 1 day ago

Remove Unused Javascript - and improve your Page Speed Insight Score

WooCommerce

Pro Verified

10

Deactivate some WooCommerce Checkout Fields

Added: 1 year ago

Last Updated: 3 weeks ago

Deactivate some WooCommerce Checkout Fields from showing

Elementor

AI Verified

6

CSS Grid Aid

Added: 8 months ago

Last Updated: 2 months ago

This can be used for any WordPress Builder to aid working with CSS Grids.