materio-d9/web/modules/custom/materio_commerce/materio_commerce.module

23 lines
771 B
Plaintext
Raw Normal View History

2021-06-25 14:00:13 +02:00
<?php
2021-07-07 11:58:02 +02:00
function materio_commerce_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'commerce_checkout_flow_multistep_default') {
if ($form["#step_id"] == "review") {
$t="t";
// $form['buttons']['continue']['#value'] = t('Desired Custom Text Here');
$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';
}
2021-07-07 11:58:02 +02:00
}