SHARE
TWEET

My WooCommerce Custom Code

a guest Mar 28th, 2014 13 Never
  1. <?php
  2. /**
  3.  * Plugin Name: My Woocommerce Custom Code
  4.  * Plugin URI: http://www.reddit.com/r/woocommerce/comments/21g33g/custom_code_gets_overwritten_when_updating/
  5.  * Description: My Woocommerce custom code.
  6.  * Version: 1.0
  7.  * Author: JAX
  8.  * Author URI: http://www.reddit.com/r/woocommerce/comments/21g33g/custom_code_gets_overwritten_when_updating/
  9.  * License: GPL2
  10.  */
  11.  
  12. add_action('woocommerce_after_order_notes', 'my_custom_checkout_field');
  13. function my_custom_checkout_field( $checkout ) {
  14.         echo '<div id="my_custom_checkout_field"><h2>'.__('').'</h2>';
  15.         woocommerce_form_field( 'dob', array(
  16.         'type'          => 'text',
  17.         'class'         => array('my-field-class form-row-wide'),
  18.         'label'         => __('Date Of Birth'),
  19.         'placeholder'       => __('MM/DD/YYYY'),
  20.         'required' => true,
  21.         ), $checkout->get_value( 'dob' ));
  22. echo '</div>';
  23. }
  24. ?>
RAW Paste Data
Top