I'm using commerce and want to alter the checkout form in a custom module to prepopulate certain fields and hide them.
However, I'm not able to do this using hook_form_alter()
as well as hook_commerce_checkout_pane_alter()
.
Here's my sample code:
function MYMODULE_form_alter($form, &$form_state, $form_id) {
global $user;
switch ($form_id) {
case 'commerce_checkout_form_checkout':
// Rename the button for example.
$form['buttons']['continue']['#value'] = t('Overridden value');
break;
}
}
How can I edit fields that are displayed on checkout?
Is there some other hook I should use?
Thanks!