skip to Main Content

How to disable fields that are pre-filled in WooCommerce checkout?

I would like to prevent (make these fields readonly, for example) users from changing their billing information on the WooCommerce checkout form. I'm currently using this code snippet: add_filter('woocommerce_billing_fields', 'mycustom_woocommerce_billing_fields', 10, 1 ); function mycustom_woocommerce_billing_fields($fields) { $fields['billing_first_name']['custom_attributes'] = array('readonly'=>'readonly'); $fields['billing_last_name']['custom_attributes']…

VIEW QUESTION
Back To Top
Search