I want to add a product programmatically to the cart. My product is added by using the following code. But it didn't return the quote item id. How can I get the item id? Here is my code
$id = 100;
$qty = '2';
$_product = Mage::getModel('catalog/product')->load($id);
$cart = Mage::getModel('checkout/cart');
$cart->init();
$cart->addProduct($_product, array('qty' => $qty));
$cart->save();
Mage::getSingleton('checkout/session')->setCartWasUpdated(true);