Question

I'm working with Magento EE 1.12.0.0

In one of my modules I have overridden Mage_Catalog_Block_Layer_Filter_Price and it works perfectly fine in my localhost, but when I install the same module in my live site, it doesn't work.

That means

all the files are getting overridden except "Royal_Filters_Block_Catalog_Layer_Filter_Price" which extends Mage_Catalog_Block_Layer_Filter_Price

my config file:

<global>
...
<blocks>
        <catalog>
            <rewrite>
                <layer_state>Royal_Filters_Block_Catalog_Layer_State</layer_state>
                <layer_view>Royal_Filters_Block_Catalog_Layer_View</layer_view>
                <product_list_toolbar>Royal_Filters_Block_Catalog_Product_List_Toolbar</product_list_toolbar>
                <layer_filter_attribute>Royal_Filters_Block_Catalog_Layer_Filter_Attribute</layer_filter_attribute>
                <layer_filter_price>Royal_Filters_Block_Catalog_Layer_Filter_Price</layer_filter_price>
            </rewrite>
        </catalog>
...
</blocks>
...
</global>

All the other four classes are overridden but not the last one.

Also my other modules work good and fine.

My live site is exactly the same as in my localhost.

But still live site
uses Mage_Catalog_Block_Layer_Filter_Decimal. can I override Mage_Catalog_Block_Layer_Filter_Decimal instead of Mage_Catalog_Block_Layer_Filter_Price, will it work?

Was it helpful?

Solution 3

Actually my live site use Mage_Catalog_Block_Layer_Filter_Decimal for price filter, so overriden that class to achieve what I need.

my config.xml

<global>
...
<blocks>
        <catalog>
            <rewrite>
                <layer_state>Royal_Filters_Block_Catalog_Layer_State</layer_state>
                <layer_view>Royal_Filters_Block_Catalog_Layer_View</layer_view>
                <product_list_toolbar>Royal_Filters_Block_Catalog_Product_List_Toolbar</product_list_toolbar>
                <layer_filter_attribute>Royal_Filters_Block_Catalog_Layer_Filter_Attribute</layer_filter_attribute>
                <layer_filter_decimal>Royal_Filters_Block_Catalog_Layer_Filter_Decimal</layer_filter_decimal>
            </rewrite>
        </catalog>
...
</blocks>
...
</global>

and I extend Mage_Catalog_Block_Layer_Filter_Decimal in my Block

OTHER TIPS

Make sure you spelled the files & folders name correctly. Royal/Filters/Block/Catalog/Layer/Filter/Price.php. If your local machine is on windows (that is case insensitive for file names) and the live site is on linux (case sensitive) you might get these kind of issues. Check the log folders also. Also check it there is an other extension overriding the same block.
[EDIT]
Magento EE has a set of blocks for the layer filter. Maybe one of them is used in your case. Here is an example: Enterprise_Search_Model_Catalog_Layer_Filter_Price.
Activate the template path hints with block class names also, and see what type of block is used for rendering the price filter.

Quite possible you have an extension on a remote host which you don't have locally and this extension also overrides Mage_Catalog_Block_Layer_Filter_Price.

In this case the solution (not quite nice though) may be to extend this extension's class instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top