title: Magento remove item from cart from observer
body: <p>Is there any way that we can remove the Items from the cart. Actually I have dynamic Grouped products were I need to allow the user to buy the item inside the grouped product. Now when someone only select the Item under the grouped product then it allow to buy that and need to stop or remove the group product from the cart. </p>
  
  <p>I had tried with checkout_cart_product_add_after Observer and used below logic, but it is not working</p>
  
  <pre><code>$cartHelper = Mage::helper('checkout/cart');
                  $items = $cartHelper-&gt;getCart()-&gt;getItems();
                  foreach ($items as $item) {
                      if ($item-&gt;getProduct()-&gt;getId() == $productId) {
                          $itemId = $item-&gt;getItemId();
                          $cartHelper-&gt;getCart()-&gt;removeItem($itemId)-&gt;save();
                          break;
                          }
                      }
                      return; 
  </code></pre>
  
  <p>Please help me guys.</p>
  
  <p>Thanks in advance.</p>