Drupal Commerce Shopping Cart Form Alter
Simple mistake, you don't change $form but only $item if you did

foreach($form['edit_delete'] as &amp;$item) {


or

foreach($form['edit_delete'] as $key =&gt; $item) {
  ...
  $form['edit_delete'][$key] = $item;
}


it should work.