Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Plugin Name: My Woocommerce Custom Code
- * Plugin URI: http://www.reddit.com/r/woocommerce/comments/21g33g/custom_code_gets_overwritten_when_updating/
- * Description: My Woocommerce custom code.
- * Version: 1.0
- * Author: JAX
- * Author URI: http://www.reddit.com/r/woocommerce/comments/21g33g/custom_code_gets_overwritten_when_updating/
- * License: GPL2
- */
- add_action('woocommerce_after_order_notes', 'my_custom_checkout_field');
- function my_custom_checkout_field( $checkout ) {
- echo '<div id="my_custom_checkout_field"><h2>'.__('').'</h2>';
- woocommerce_form_field( 'dob', array(
- 'type' => 'text',
- 'class' => array('my-field-class form-row-wide'),
- 'label' => __('Date Of Birth'),
- 'placeholder' => __('MM/DD/YYYY'),
- 'required' => true,
- ), $checkout->get_value( 'dob' ));
- echo '</div>';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement