I am trying to rewrite the main file from magento. Somehow this does not overwrite the code. I am trying to overwrite the getProduct () function.
Tipfix / block / product / view.php
<?php class WP_Tipfix_Block_Catalog_Product_View extends Mage_Catalog_Block_Product_View { public function getProduct() { if (!Mage::registry('product') && $this->getProductId()) { $product = Mage::getModel('catalog/product')->load($this->getProductId()); Mage::register('product', $product); }
Tipfix / etc. /config.xml
<blocks> <WP_Tipfix> <class>WP_Tipfix_Block</class> </WP_Tipfix> <catalog> <rewrite> <product_view>WP_Tipfix_Block_Catalog_Product_View</product_view> </rewrite> </catalog> </blocks>
I know what I'm doing wrong.
Gr. Lex
source share