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>

Update code:

<?xml version="1.0"?>

and observer.php

class Mour_Customgroup_Model_Observer

    public function changeprice(Varien_Event_Observer $event) {
        $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;

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

  • you can use the checkout_cart_save_after or checkout_cart_product_add_after event. you want to change this for all products or for only particular products – saravanavelu Jan 6 '15 at 5:06
  • no i want to show different price on product detail pages only not in cart – user1799722 Jan 6 '15 at 5:12
  • you want the same price to be added to cart also – saravanavelu Jan 6 '15 at 5:14
  • yeah i am able to do that via observer ,just need to show different price on product detail page via observer' – user1799722 Jan 6 '15 at 5:21

you can use catalog_product_load_after event to change the product price in view page.


public function loadaftercatalog($event) {
    $product = $event->getEvent()->getProduct();
    $originalprice = $product->getPrice();
    $customprice = $originalprice+20;

  • getting same price nothing adds – user1799722 Jan 6 '15 at 5:43
  • I tried this, it works good for me. Please clear cache and check and check you can call the coreect observer file – saravanavelu Jan 6 '15 at 5:44
  • see i update my code according to you, cleared cache still not working – user1799722 Jan 6 '15 at 5:46
  • hii after adding your code i get error maximum nesting level of 200 exceeded why so ??.. – user1799722 Jan 6 '15 at 6:33
  • check the product price before set new price – saravanavelu Jan 6 '15 at 7:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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