asadsuman

Edit your billing Fields text

Mar 18th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. add_filter( 'woocommerce_billing_fields', 'custom_woocommerce_billing_fields' );
  2.  
  3. function custom_woocommerce_billing_fields( $fields ) {
  4.  
  5. // Over-ride a single label
  6. $fields['billing_first_name']['label'] = 'Your label';
  7.  
  8. // Over-ride a single required value
  9. $fields['billing_first_name']['required'] = false;
  10.  
  11. // Over-ride the entire thing
  12. $fields['billing_postcode'] = array(
  13. 'label' => __('Postcode', 'woothemes'),
  14. 'placeholder' => __('Postcode', 'woothemes'),
  15. 'required' => true,
  16. 'class' => array('form-row-last update_totals_on_change')
  17. );
  18.  
  19. /**
  20. * You can over-ride - billing_first_name, billing_last_name, billing_company, billing_address_1, billing_address_2, billing_city, billing_postcode, billing_country, billing_state, billing_email, billing_phone
  21. */
  22.  
  23. return $fields;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment