I want just added product’s final price on “add to cart after” event. Here final price is in a term of, price with selected options (configured option, custom options). So how can I get this price?
I tried following codes to take final price but any of this is not working:
Observer.php
public function addtocartAfter($observer)
{
$quote_item= Mage::getSingleton('checkout/session')->getQuote()->getItemByProduct($observer->getEvent()->getProduct());
}
Or
public function addtocartAfter($observer)
{
$quote = Mage::helper('checkout/cart')->getCart()->getQuote();
$quote_item = Mage::getModel('sales/quote_item')->load($quote->getItemByProduct($observer->getEvent()->getProduct())->getId());
}
But when I tried to get price like : $quote_item->getPrice()
.I got product’s price,without selected options's price.
Best Answer
I found the solution for this. Use the code given at below: