Forked from vishalbasnet23/override-checkout-fields
Last active
August 29, 2015 14:19
-
-
Save bhaskarkc/ebb44fa8e2a4e8b5a39d 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
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); | |
function custom_override_checkout_fields( $fields ) { | |
$fields['billing']['billing_city']['label'] = 'City'; | |
$fields['billing']['billing_phone']['required'] = false; | |
$fields['order']['order_comments']['placeholder'] = 'My new placeholder'; | |
//removing fields | |
unset($fields['order']['order_comments']); | |
//adding custom fields | |
$fields['shipping']['shipping_phone'] = array( | |
'label' => __('Phone', 'woocommerce'), | |
'placeholder' => _x('Phone', 'placeholder', 'woocommerce'), | |
'required' => false, | |
'class' => array('form-row-wide'), | |
'clear' => true | |
); | |
return $fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment