I’m creating a new module for Cash on Delivery.
This module will only take the shipping info from the customer, so, the payment part is easy, there’s no form at all on the payment info step of checkout.
The tricky part is: It will be more expensive for the customer to get the product using this way (usually the shipping with COD is more expensive). So, when the user selects COD i have to add an user-defined ammount to the grand total of the order.
I’ve looked through the code, and found that one of the methods which calculates this grand total is: Mage_Sales_Model_quote->getTotals(). So I need to overload this method by creating a new class inside my module and declaring it on config.xml.
I did it, but it made no difference at all. I’ve created a class called Mage_Cashondelivery_Model_Quote and created the getTotals() method inside it. Also, I’ve added these lines to config.xml:
Am I doing anything wrong here? Also, will the method always be overloaded, or only when it is enabled?
Many thanks and best regards,