I have few core files modifications in my app/code/local/Mage folder, but I wan't to make them work as magento module.
My example: I did few small modifications in method getValueHtml in file Mage/Bundle/Block/Sales/Order/Items/Renderer.php and now I wan't this rewritten method to be used.
I have followed online tutorials for blocks rewrite but it is not working for me. I'm missing something, but I can't figure it out. These are my module files:
app/code/local/MyCompany/Bundleproducts/etc/config.xml:
<?xml version="1.0"?>
<config>
<modules>
<MyCompany_Bundleproducts>
<version>1.0.0</version>
</MyCompany_Bundleproducts>
</modules>
<global>
<blocks>
<bundle>
<rewrite>
<sales_order>MyCompany_Bundleproducts_Block_Sales_Order_Items_Renderer</sales_order>
</rewrite>
</bundle>
</blocks>
</global>
</config>
app/code/local/MyCompany/Bundleproducts/Block/Sales/Order/Items/Renderer.php:
<?php
class MyCompany_Bundleproducts_Block_Sales_Order_Items_Renderer extends Mage_Bundle_Block_Sales_Order_Items_Renderer
{
public function getValueHtml($item)
{
if ($attributes = $this->getSelectionAttributes($item)) {
return sprintf('%d', $attributes['qty']) . ' TEST ' .
$this->escapeHtml($item->getName());
} else {
return $this->escapeHtml($item->getName());
}
}
}
and app/etc/modules/MyCompany_Bundleproducts.xml
<?xml version="1.0"?>
<config>
<modules>
<MyCompany_Bundleproducts>
<active>true</active>
<codePool>local</codePool>
</MyCompany_Bundleproducts>
</modules>
</config>
Can someone point me to the right direction? Thanks!