Created
October 10, 2014 06:44
-
-
Save vishalbasnet23/6f029666894ad12894e0 to your computer and use it in GitHub Desktop.
Override filter for woocommerce checkout fields
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