Advertisement
majeedraza

WooCommerce - Make checkout fields readonly

Jul 27th, 2018
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. <?php
  2. // WooCommerce - Make checkout fields readonly
  3. add_action( 'woocommerce_checkout_fields', 'readonly_billing_last_name', 10, 1 );
  4. function readonly_billing_last_name( $checkout_fields ) {
  5.   $checkout_fields['billing']['billing_first_name']['custom_attributes'] = array( 'readonly' => 'readonly' );
  6.   $checkout_fields['billing']['billing_last_name']['custom_attributes'] = array( 'readonly' => 'readonly' );
  7.   return $checkout_fields;
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement