I'm trying to use hook_form_FORM_ID_alter() in my theme's template.php file to change the 'Remove' button in the Commerce add to cart form to an image button. To do this I'm using the following code:
function tempestra_form_views_form_commerce_cart_form_default_alter(&$form, &$form_state) {
foreach($form['edit_delete'] as $item) {
if($item['#type'] == 'submit') {
$item['#type'] = 'image_button';
$item['#src'] = base_path() . drupal_get_path('theme', 'tempestra') . '/images/search.png';
unset($item['#name']);
dpm($item);
}
}
}
When I look in the array printed by dpm()
everything is as it should be, however the HTML for the image button isn't printed.
Thanks in advance.