Josh_Carrol
New Member
Magento question.I just bought and installed a Canada Post extension that calculates the shipping cost. It works fine but I want to tweak it a little bit.I don't want to modify directly the extension so I want to make an other extension that extends the Canada Post model to change only one function. Basically, what i'm trying to do is to overwrite an existing function.Here's the code to do so in my extension config.xml:\[code\]<global> <!--Rewrite post canada extension--> <models> <canadapost> <rewrite> <carrier_shippingmethod>ADMSport_RabaisPosteCan_Model_Carrier_ShippingMethod</carrier_shippingmethod> </rewrite> </canadapost> <rabaispostecan> <class>ADMSport_RabaisPosteCan_Model</class> </rabaispostecan> </models></global>\[/code\]The code in the class to overwrite:\[code\]class Mage_CanadaPost_Model_Carrier_ShippingMethod extends Mage_Shipping_Model_Carrier_Abstract\[/code\]The code on my class\[code\]class ADMSport_RabaisPosteCan_Model_Carrier_ShippingMethod extends Mage_CanadaPost_Model_Carrier_ShippingMethod\[/code\]I attached the file structure to this topic.I really don't understand what i'm doing wrong. I already overwritten magento basic function in the past but I never overwritten functions in an other extension appart.Any help ?Thanks a lot and sorry for the spelling errors, english is not my native language.http://i.stack.imgur.com/pSMrA.png