Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

[SOLVED] override Mage_Sales_Model_Mysql4_Order_Collection. 
 
symmetrics_bl
Member
 
Avatar
Total Posts:  58
Joined:  2008-01-07
Hannover
 

hi magento folks!
does anybody know why this rewrite won’t happen?
i want to override the class Mage_Sales_Model_Mysql4_Order_Collection.
here i do the following:

<?php
class Mycompany_Sales_Model_Mysql4_Order_Collection extends Mage_Sales_Model_Mysql4_Order_Collection
{
  
public function __construct()
  
{
    
echo 'ping';
  
}
}

...
<global>
  <
models>
    <
sales>
      <
rewrite>
        <!-- 
does not work -->
        <
mysql4_order_collection>Mycompany_Sales_Model_Mysql4_Order_Collection</mysql4_order_collection>
        <!-- 
works! -->
        <
order_invoice>Mycompany_Sales_Model_Order_Invoice</order_invoice>
      </
rewrite>
    </
sales>
  </
models>
</global>
...

where am i mistaken?

 
Magento Community Magento Community
Magento Community
Magento Community
 
mzentrale1
Guru
 
Total Posts:  731
Joined:  2007-12-06
Stuttgart, Germany
 

Hi,

try this smile!!! i know - it funzt!!

<global>
  <
models>
    <
sales>
      <
rewrite>        
        <
order_invoice>Mycompany_Sales_Model_Order_Invoice</order_invoice>
      </
rewrite>
    </
sales>
    <
sales_mysql4>
        <
rewrite>
            <
order_collection>Mycompany_Sales_Model_Mysql4_Order_Collection</order_collection>
         </
rewrite>
    </
sales_mysql4>
  </
models>
</global>

cheers

s.

 
Magento Community Magento Community
Magento Community
Magento Community
 
symmetrics_bl
Member
 
Avatar
Total Posts:  58
Joined:  2008-01-07
Hannover
 

thank you very much! smile it works!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top