Advertisement
Guest User

My WooCommerce Custom Code

a guest
Mar 28th, 2014
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 KB | None | 0 0
  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. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement