improved first step of create order form

This commit is contained in:
2021-08-23 00:46:52 +02:00
parent a39da8fc36
commit 05b2621bc7
7 changed files with 191 additions and 3 deletions

View File

@@ -8,4 +8,16 @@ function materio_commerce_form_alter(&$form, &$form_state, $form_id) {
$form['actions']['next']['#value'] = t('Place your order');
}
}
}
function materio_commerce_form_commerce_order_add_form_alter(&$form, &$form_state, $form_id) {
$currentUser = \Drupal::currentUser();
$roles = $currentUser->getRoles();
if (in_array("admin", $roles)){
$t="t";
$form['type']['#default_value'] = 'materio_order_type';
$form['type']['#disabled'] = true;
$form['customer']['uid']['#selection_handler'] = 'default:user_by_email';
}
}