title: Magento - Remove Item from Cart by Sku
body: <p>i try to remove a product from Cart by Sku - is it possible?</p>
  
  <p>I tried the following Code in cartcontroller.php but without success ....</p>
  
  <p>I know it should work by ID but by Sku would be easier for me.</p>
  
  <pre><code>$session = Mage::getSingleton('checkout/session');
  $quote = $session-&gt;getQuote();
  
  $cart = Mage::getModel('checkout/cart');
  $cartItems = $cart-&gt;getItems();
  
  foreach($cartItems as $item) {
    if ($item-&gt;getSku() == promo){
      $quote-&gt;removeItem($item-&gt;getId())-&gt;save();
    }
  }
  
  Mage::getSingleton('checkout/session')-&gt;setCartWasUpdated(true);
  $cart-&gt;init();
  </code></pre>