Forked from MinaPansuriya/WooCommerce Edit Checkout Billing Address fields
Last active
September 25, 2017 22:11
-
-
Save dherbold/ec9e957b5667a550399897748c7d5914 to your computer and use it in GitHub Desktop.
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 /** | |
* @Title: WooCommerce Edit Checkout Billing Address fields | |
*/ | |
add_filter( 'woocommerce_checkout_fields' , 'dfh_woo_mod_woo_billing_address_fields' ); | |
function dfh_woo_mod_woo_billing_address_fields( $fields ) { | |
// Remove Billing Company Field | |
unset($fields['billing']['billing_company']); | |
// Rename Label of for Order Comments | |
$fields['order']['order_comments']['label'] = 'Personalized Message'; | |
// Change Placeholder text of Order Comments | |
$fields['order']['order_comments']['placeholder'] = 'Add message here'; | |
// Make postcode non-required fieid | |
$fields['billing']["billing_postcode"]['required'] = false; | |
// Remove Billing Address 2 field | |
unset($fields['billing']['billing_address_2']); | |
return $fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment