Created
August 11, 2016 07:19
-
-
Save xadapter/f4cfc0d98e94c1170feb2ec65ae2ebeb to your computer and use it in GitHub Desktop.
WooCommerce - Add a new Custom Checkout Field
This file contains hidden or 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_action( 'woocommerce_after_order_notes', 'xa_new_custom_checkout_field' ); | |
| function xa_new_custom_checkout_field( $checkout ) { | |
| echo '<div id="xa_new_custom_checkout_field"><h2>' . __('SSN') . '</h2>'; | |
| woocommerce_form_field( 'new_field_ssn', array( | |
| 'type' => 'text', | |
| 'class' => array('ssn-field-class form-row-wide'), | |
| 'label' => __('SSN Number'), | |
| 'placeholder' => __('Enter SSN'), | |
| ), $checkout->get_value( 'new_field_ssn' )); | |
| echo '</div>'; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment