materio_commerce.module 771 B

1234567891011121314151617181920212223
  1. <?php
  2. function materio_commerce_form_alter(&$form, &$form_state, $form_id) {
  3. if ($form_id == 'commerce_checkout_flow_multistep_default') {
  4. if ($form["#step_id"] == "review") {
  5. $t="t";
  6. // $form['buttons']['continue']['#value'] = t('Desired Custom Text Here');
  7. $form['actions']['next']['#value'] = t('Place your order');
  8. }
  9. }
  10. }
  11. function materio_commerce_form_commerce_order_add_form_alter(&$form, &$form_state, $form_id) {
  12. $currentUser = \Drupal::currentUser();
  13. $roles = $currentUser->getRoles();
  14. if (in_array("admin", $roles)){
  15. $t="t";
  16. $form['type']['#default_value'] = 'materio_order_type';
  17. $form['type']['#disabled'] = true;
  18. $form['customer']['uid']['#selection_handler'] = 'default:user_by_email';
  19. }
  20. }