0

Hi i'm newbie to magento, trying to override catalog price block to use my custom price.phtml (Coz it's conflicting if i do any css updates). To do this I have done below steps,

Copied app/code/core/Mage/Catalog/Block/Product.php to app/code/local/Mage/Catalog/Block/Product.php

In the copied file, about Line 61, changed

public function getPriceHtml($product)
    {
        $this->setTemplate('catalog/product/price.phtml');
        $this->setProduct($product);
        return $this->toHtml();
    }

to

public function getPriceHtml($product)
    {
        $this->setTemplate('catalog/product/customprice.phtml');
        $this->setProduct($product);
        return $this->toHtml();
    }

Is there any further config required to achieve this ?

1

If you want to do changes in theme(in phtml files), it is better to create your own theme and copy price.phtml in your theme and do necessary changes.
Create your theme under app/design/frontend/default/[YOUR THEME]/ and copy your file in your custom theme like app/design/frontend/default/[YOUR THEME]/template/catalog/product/price.phtml
And select your theme in admin-end System -> Configuration -> General -> Design
http://www.magentocommerce.com/design_guide/articles/working-with-magento-themes
http://blog.belvg.com/create-custom-themes-magento-front-end-developer-certification.html

| improve this answer | |

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