If you like to fix any details for your customer on the checkout page and do not like to be updated by the customer then here is how you can fix that:
You can not use disabled
attribute as most of the fields are required
and Disabled <input> elements in a form will not be submitted! so readonly
attribute is the preferred method here.
readonly can only be applied on text
and textarea
in HTML so to fix the value of dropdown like country or state please refer to our other tutorial.
If you like to fix all the fields on the checkout form. Let’s suppose customer placing the additional order which may confuse you if he has filled different details then you can fix/disable all the fields using the foreach
loop under the same hook as shown here.