Last active
May 2, 2017 03:25
-
-
Save harishankerr/e4e04e37544724079fe08828550dda29 to your computer and use it in GitHub Desktop.
Remove Checkout Fields From WooCommerce Checkout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Use the PHP Tag only if needed | |
/* | |
Snippet to remove Company And Phone Fields From The Checkout Page In WooCommerce | |
--------------------------------------------------------------------------------- | |
Please paste this code snippet at the bottom of the functions.php file in your theme, or use a Code Snippets Plugin (https://wordpress.org/plugins/code-snippets/)plugin to add this snippet. | |
*/ | |
function wc_ninja_remove_checkout_field( $fields ) { | |
unset( $fields['billing']['billing_company'] ); // Removes the Company Field. | |
unset( $fields['billing']['billing_phone'] ); // Removes the Phone Field. | |
return $fields; | |
} | |
add_filter( 'woocommerce_checkout_fields' , 'wc_ninja_remove_checkout_field' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment