below is my config.xml file code.

<?xml version="1.0"?>
            <catalog_product_get_final_price><!-- observe the event -->

below is my Observer.php files code.

class Eventprice_Meta_Model_Observer {

    public function changeprice(Varien_Event_Observer $event) {
        return 5;

            $product = $event->getEvent()->getProduct();
            $originalprice = $product->getPrice();
            $customprice = $originalprice+$pricetoadd;
        echo 'call';

i want to set the Product price $5 on product view page. i write a function 'changeprice' for changing the product price. but this function is not call please checked where i create a mistake in code.

2 Answers 2


You declared your observer in the <adminhtml> area. So it does not get triggered on frontend.
You need to replace




Next problem. return 5; will not make the price of the product 5. It will do nothing.
You need to make it $observer->getProduct()->setFinalPrice(...your price here...)

Next one. Don't use $_GET['id']. Use Mage::app()->getRequest()->getParam('id')

And the last one for now. calling return 5 at the top of the method will not execute the rest of the method. So you never reach echo 'call'; exit;

  • Perfect solution.+1 for me.
    – liyakat
    May 26, 2015 at 12:20
  • right Thanks awesome thanks this is working. May 26, 2015 at 12:24

Observer parameters issue:

There are issue with parameters on observer. For getting the product id try with $observer->getProduct()->Id(); As system when catalog_product_get_final_price event fire then the two parameter has been sended.

  • Current product Object: $event->getEvent()->getProduct();
  • Other Qty: $event->getEvent()->getQty().

No need load product object again.

Mage::dispatchEvent('catalog_product_get_final_price', array('product' => $product, 'qty' => $qty));

As @Marius told for set the final price,you need to use $event->getEvent()->getProduct()->setFinalPrice() for set final price and set event area are from adminhtml to frontend for properly works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.