0

Right now, the HTML of the commerce shipping service consists by input buttons, where you select the desired method.
I'd like to is to have it in the form of a select, and - more importantly - have no default shipping method selcted.
How to do it?

  • 1
    hook_form_alter is all you need – Clive Nov 29 '14 at 9:53
1

As suggested by clive, You should try this:

function MYMODULE_form_commerce_checkout_form_alter($form, &$form_state, $form_id) {
  ...
}

or

function MYMODULE_form_alter($form, &$form_state, $form_id) {
  switch ($form_id) {
    case 'commerce_checkout_form':
      ...
    break;
}
  • Thanks! Could you maybe point some examples? – Dalmaz Nov 29 '14 at 10:15
  • Beginner's problems with trying to deal with this: dpm($form_id) outputs "commerce_checkout_form_checkout" rather then "commerce_checkout_form", so I guess that's what I should use? – Dalmaz Nov 29 '14 at 11:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.