on product detail page i want to show price other than original price via observer.
Say product with price 100 will show price as 120 or 110
which observer should i use to do same
I found product price comes from catalog/product/price.phtml
is there any way in admin > catalog > category > custom deign
to call my custom price.html for specifi category
something like below
<reference name="product.info">
<action method="setTemplate"><template>catalog/product/view_mour.phtml</template></action>
</reference>
Update code:
<?xml version="1.0"?>
<config>
<modules>
<Mour_Customgroup>
<version>0.1.0</version>
</Mour_Customgroup>
</modules>
<frontend>
<events>
<catalog_product_load_after>
<observers>
<setadiscountprice>
<type>singleton</type>
<class>Mour_Customgroup_Model_Observer</class>
<method>changeprice</method>
</setadiscountprice>
</observers>
<catalog_product_load_after>
</events>
</frontend>
</config>
and observer.php
<?php
class Mour_Customgroup_Model_Observer
{
public function changeprice(Varien_Event_Observer $event) {
if($_GET['id']){
$pricetoadd=Mage::getModel('catalog/product')->load($_GET['id'])->getPrice(); // error comes after adding this line
$product = $event->getEvent()->getProduct();
$originalprice = $product->getPrice();
$customprice = $originalprice+$pricetoadd;
$product->setPrice($customprice);
}
}
}
i am trying to add price of product (id from get parameter) to product price
if i remove this line : $pricetoadd=Mage::getModel('catalog/product')->load($_GET['id'])->getPrice();
it works fine