i wrote below observer to add extra price to product price based on get paramter id of product
<catalog_product_load_after>
<observers>
<setcustomprice>
<type>singleton</type>
<class>Mour_Customgroup_Model_Observer</class>
<method>loadaftercatalog</method>
</setcustomprice>
</observers>
</catalog_product_load_after>
observer.php
public function loadaftercatalog(Varien_Event_Observer $event) {
$pricetoadd=Mage::getModel('catalog/product')->load(233); // error caused after adding this line
$product = $event->getEvent()->getProduct();
$originalprice = $product->getPrice();
$customprice = $originalprice+$pricetoadd->->getPrice();
$product->setPrice($customprice);
}
after adding code to observer i keep on getting error maximum nesting level of 500 reachesd i thing my observer i getting called more than once any better way to solve the issue
pls suggest
What i am trying to do :
1: there are two categories A, B if user browser any product of A he has option to buy it with any other product in B
so i pass id of product in A via get parameter and show Products of category B with added price based on id of product in get parameter
if($_GET['id']){}
This wrong$observer ->getProduct();
you will get the product detail you do not required to load product againMage::app()->getRequest()->getParams()
for fetching request data