I am trying to catch the event that fires once an item is added to the cart. I'm currently watching the following event: checkout_cart_product_add_after
According to magento source this event is fired after everything is done to the Quote. but when i access the cart id and the quote id the values are empty:
$quoteItem = $observer->getQuoteItem();
$quote_item_id = $quoteItem->getItemId();
$cart = Mage::getSingleton('checkout/session');
$quote_id= $cart->getQuoteId();
The above returns empty for both ids when there are no items in the cart, if the cart already has an item the cart id has value but the quote_item_id doesn't.
Notice this has been asked before, but the question was never resolved, and the discussion ended up straying from this issue. I need the quote_item_id.
$quoteItem = $observer->getEvent()->getQuoteItem();
Mage::log($quoteItem)
and see invar/log/system.log
how the quote item looks like. Maybe you get an idea from there.