Now that Drupal 8 Commerce moved to Inline Entity Form approach. I am having trouble of altering Address for fields for the checkout... In the past I could do this:

function hook_field_widget_form_alter(&$element, FormStateInterface $form_state, $context) {

  $element["address"] .........


Essentially I was adding couple extra classes to fields, adding placeholder attributors and adding couple of hidden fields... But now that we moved to InlineEntityForm I have trouble finding this....

I am trying at the moment of using hook_inline_entity_form_table_fields_alter() or hook_inline_entity_form_entity_form_alter() but cannot seems to be able to do the same thing....

If anybody could point me to the right direction that would amazing.


  • Commerce uses the Inline Form API, that has nothing to do with the Inline Entity Form module, so the hooks in question are not invoked. hook_field_widget_form_alter() should still work – Bojan Zivanovic Jun 18 at 14:09
  • Cheers! I will try to debug this deeper... – puogintas Aug 13 at 14:03

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.