• Resolved lucasln1

    (@lucasln1)


    Hi im using this code to make the billing_email field turn into a read only field

    add_action (‘woocommerce_checkout_fields’,’readonly_billing_email’,10,1);
    function readonly_billing_email($checkout_fields){
    $checkout_fields[‘billing’][‘billing_email’][‘custom_attributes’] = array(‘readonly’ => ‘readonly’);
    return $checkout_fields;

    }

    But its notworkig , do you guys know why ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Worked for me. Did you try it with only Storefront and WooCommerce active, to be able to rule out interference from something else.

    Do you have error logging enabled, if so anything in the log.

    Try changing the 10 to 10000 so your snippet runs after anything else.

    Ensure you are using straight quotes and not smart quotes.

    Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Howdy!

    We haven’t heard back from you in a while, so I’m going to go ahead and mark this thread as resolved. If you have any other questions please start a new thread.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Readonly not working’ is closed to new replies.