This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

My WooCommerce Custom Code

By: a guest on Mar 28th, 2014  |  syntax: PHP  |  size: 0.85 KB  |  views: 6  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. ?>
clone this paste RAW Paste Data