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, 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

Magento Forum

Cash on delivery module: problems with the order in admin panel!!! 
Sr. Member
Total Posts:  108
Joined:  2008-05-31

Hi, i have a new “cash on delivery payment” module.
This is part of my class:

class Mage_MyModule_Model_Quote extends Mage_Sales_Model_Quote {

public function getTotals() {

$res = parent::getTotals();

$cash_ondelivery = Mage::getModel(’sales/quote_address_total’);
$cash_ondelivery->setData(’code’, ‘cash_ondelivery_amount’);
$cash_ondelivery->setData(’title’, ‘Cash on delivery amount’);
$cash_ondelivery->setData(’value’, $amount_base);
array_push($res, $cash_ondelivery);

$res[’tax’]->setData(’value’,$res[’tax’]->getData(’value’) + $amount_tax);
$res[’grand_total’]->setData(’value’,$res[’grand_total’]->getData(’value’) + $amount);

return $res;

So, i’m created a new “sales/quote_address_total” object and i have added it into the $res array;
i have calculated the base cost of my amount, without tax and i have calculate the tax of my amount;
i have added the tax into the ‘tax’ element and i have refreshed the ‘grand_total’ element into the $res array.

When i process for checkout an order, it’s ok!
But, into the admin panel, i have the order:
- without the “Cash on delivery amount” section (the object that i have created)
- with the “tax” without the tax of my Cash on delivery amount
- with the “grand total” without the Cash on delivery amount

If i open the order in “my orders” in “MyAccount” i have the same problem!!!

Have you any idea for help me???

Thank you.

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