I am using Drupal Commerce 2.11 and Drupal 8.6.9. I need to make a simple edit to the address forms in the checkout - changing the #empty_option of the "locality" select boxes. However, this is proving far more difficult than I anticipated.

I've found a few posts with possible solutions using hook_input_alter or hook_widget_alter, but they seem to rely on there being an address element. In the version of Commerce and Drupal I'm using, the address appears to be hidden inside a "profile" element instead.

Does anyone know how to alter the checkout address forms in the latest version of Drupal 8 and Drupal Commerce?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.