0
votes

I am trying to rewrite a modules model which is located in the community folder, but can't seem to get it to work. The module has the following in its config.xml

<models>
    <scarletred_packingslips>
        <class>ScarletRed_Packingslips_Model</class>
    </scarletred_packingslips>
</models>

Using this, I have created my config xml with the following rewrite rule

<global>
    <models>
        <scarletred_packingslips>
            <rewrite>
                <order_fauxshipment>MyModule_Packingslips_Model_Order_FauxShipment</order_fauxshipment>
            </rewrite>
        </scarletred_packingslips>
    </models>
</global>

My folder structure is

App/Code/Local/MyModule/Packingslips/Model/Order/FauxShipment.php

My FauxShipment file has the following

class MyModule_Packingslips_Model_Order_FauxShipment extends ScarletRed_Packingslips_Model_Order_FauxShipment { 
        //exact copy of module model 

    }

I'm not too sure what I've done wrong here, I created a module config file in app/etc folder and included a depends tag to ensure my module is loaded after. I can also see my module is active from the admin.

1
I will suggest two things First try writing something that gives error anything like 'asdhfahs' in model so if your execution points error then note that there is problem with config.xml second make use of vardump() or die() to check where control giving error and lastly cross check spell one thing please try adding only <scarletred> node. If your module is registered then there must be problem with your config.xml or model. please trySudarshan Kalebere
Thanks for the tips. I added in some blurb to my model and nothing happened. I've double checked the spelling to ensure all is correct and all my paths/structure are similar to the modules. Also tried using <scarletred> and this doesn't change anything.JPK

1 Answers

0
votes

Found the answer... In the module controler, the model is loaded with Mage::getModel('scarletred_packingslips/order_fauxShipment') so all I had to do was change my rewrite from <order_fauxshipment> to <order_fauxShipment> and it worked as expected