How to use hook_form_alter with commerce checkout The module "commerce_checkout_buttons" alters the buttons in the commerce checkout process as seen below in using HOOK_form_alter. In this code, only the review form is being altered, but the changes seem to be global in the checkout process?

For example, the site I'm working with has a one-page checkout, and the Review pane doesn't include anything. Yet, the buttons are altered.

Can anyone explain how this works?

function commerce_checkout_buttons_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  switch ($form_id) {
    case 'commerce_checkout_form_checkout':
    case 'commerce_checkout_form_shipping':
    case 'commerce_checkout_form_review':
      if (isset($form['buttons']['back']['#value'])) {
        $form['buttons']['back']['#value'] = t('Back');
      }
      if (isset($form['buttons']['continue']['#value'])) {
        $form['buttons']['continue']['#value'] = t('Continue');
      }
      if (isset($form['buttons']['back']['#prefix'])) {
        unset($form['buttons']['back']['#prefix']);
      }
      if (isset($form['buttons']['cancel']['#prefix'])) {
        unset($form['buttons']['cancel']['#prefix']);
      }
      break;
  }
}
If you remove the code shown below, it would only affect the review pane.

case 'commerce_checkout_form_checkout':
    break;
case 'commerce_checkout_form_shipping':
    break;