On this page i have done customization currently i have added ajax feature to update the product price.
case 1 : suppose i am on the product view page and i have selected metal type as 18K White gold and AJAX request will send and actual product price after that if i will select the custom option then price of product is not updated properly.
So some one can please let me know what should i do in this case to work site in normal way.
Use the following event in you config.xml
<events>
<checkout_cart_product_add_after>
<observers>
<provide name>
<type>singleton</type>
<class>Test_Testing_Model_Cart_Observer</class>
<method>calculateAddToCart</method>
</provide name>
</observers>
</checkout_cart_product_add_after>
</events>
and create the observer for this with the following content.
public function calculateAddToCart($observer){
$customPrice = Mage::getSingleton(’core/session’)->getCustomPriceCalcuation(); // Provide you price i have set with session
$p = $observer->getQuoteItem();
$p->setCustomPrice($customPrice)->setOriginalCustomPrice($customPrice);
}