×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: HTML
Posted by: Joseph Riviello
Added: Apr 16, 2013 3:52 AM
Views: 52
Tags: no tags
  1. // Hook in
  2. add_filter( 'woocommerce_checkout_fields' , 'zen_override_checkout_fields' );
  3.  
  4. // Our hooked in function - $fields is passed via the filter!
  5. function zen_override_checkout_fields( $fields ) {
  6.  $fields['shipping']['shipping_gls_name'] = array(
  7.     'label'     => __('Shipping Phone:', 'woocommerce'),
  8. 'placeholder'   => _x('', 'placeholder', 'woocommerce'),
  9. 'required'  => true,
  10. 'class'     => array('form-row-wide'),
  11. 'clear'     => true
  12.  );
  13.  
  14.  return $fields;
  15. }
  16.  
  17. function zen_custom_field_admin($order){
  18.     echo "<p><strong>Shipping Phone:</strong> " . $order->order_custom_fields['_shipping_gls_name'][0] . "</p>";
  19. }
  20.  
  21. add_action( 'woocommerce_admin_order_data_after_shipping_address', 'zen_custom_field_admin', 10, 1 );