Add event in module etc/config.xml
<?xml version="1.0"?>
<config>
</frontend>
<events>
<checkout_cart_product_add_after>
<observers>
<Custom_Event_Model_Observer>
<type>singleton</type>
<class>Custom_Event_Model_Observer</class>
<method>Mytestmethod</method>
</Custom_Event_Model_Observer>
</observers>
</checkout_cart_product_add_after>
</events>
</frontend>
</config>
calculate your price in Custom/Event/Model/Observer.php
class Custom_Event_Model_Observer {
public function Mytestmethod(Varien_Event_Observer $observer) {
$item = $observer->getQuoteItem();
$item = ( $item->getParentItem() ? $item->getParentItem() : $item );
$price = 66;
$item->setCustomPrice($price);
$item->setOriginalCustomPrice($price);
$item->getProduct()->setIsSuperMode(true);
}
}
<?xml version="1.0"?>
<config>
</frontend>
<events>
<checkout_cart_product_add_after>
<observers>
<Custom_Event_Model_Observer>
<type>singleton</type>
<class>Custom_Event_Model_Observer</class>
<method>Mytestmethod</method>
</Custom_Event_Model_Observer>
</observers>
</checkout_cart_product_add_after>
</events>
</frontend>
</config>
calculate your price in Custom/Event/Model/Observer.php
class Custom_Event_Model_Observer {
public function Mytestmethod(Varien_Event_Observer $observer) {
$item = $observer->getQuoteItem();
$item = ( $item->getParentItem() ? $item->getParentItem() : $item );
$price = 66;
$item->setCustomPrice($price);
$item->setOriginalCustomPrice($price);
$item->getProduct()->setIsSuperMode(true);
}
}