Drupal Commerce Address Field - How to make the company required?
Category:
It's possible to make the Organisation name (aka Company) field on an Address required during the Drupal Commerce checkout process. With a custom module, you can do this:
/** * Implements hook_form_alter(). */ function my_module_form_alter(&$form, &$form_state, $form_id) { if ($form_id == 'commerce_checkout_form_checkout') { $form['customer_profile_billing']['commerce_customer_address']['und'][0]['organisation_block']['organisation_name']['#required'] = TRUE; } }
Comments
Imtiaz Ahmed (not verified)
Sat, 09/17/2016 - 13:00
Permalink
Hi, thanks for the helpful
Hi, thanks for the helpful post. But how can I allow image/doc upload in commerce field.
tyler
Sat, 09/17/2016 - 13:08
Permalink
Commerce Orders are Drupal
Commerce Orders are Drupal Entities, so you can add fields to them just like a content type. Go to: