Jan 14, 2014

How to override magento model.

Overriding magento model is some tricky base, that's why I want to share how this models Override.


First Mage_Reports_Model_Event_Observer
<models>
    <reports>
        <rewrite>
            <event_observer>Globe_Reports_Model_Event_Observer</event_observer>
        </rewrite>
    </reports>
</models>



Second Mage_Reports_Model_Mysql4_Product_Index_Viewed_Collection
<!-- You configs -->
<models>
    <reports_mysql4>
        <rewrite>
            <product_index_viewed_collection>Globe_Reports_Model_Mysql4_Product_Index_Viewed_Collection</product_index_viewed_collection>
        </rewrite>
    </reports_mysql4>
</models>

// Your PHP class
class Globe_Reports_Model_Mysql4_Product_Index_Viewed_Collection extends Mage_Reports_Model_Mysql4_Product_Index_Viewed_Collection{

// Put possible override methods or 
//  addition methods you want here
}

Jan 12, 2014

SVN - treat text file as binary.

When I add xml to my SVN I got this one

A (bin) config.xml

To fix this one issue svn command.

svn propset svn:mime-type "text/xml" config.xml

and get an output
property 'svn:mime-type' set on 'config.xml'

:)