I'm trying to change the order grand total programmatically for purpose of allowing users to pay portion of the payment. I tried editing core file Mage_Payment_Model_Info method getMethodInstance
if (method_exists($instance,"getOrder")){
$order = $instance->getOrder();
}else{
$session = Mage::getSingleton('checkout/session');
$order = Mage::getModel('sales/order');
$order->loadByIncrementId($session->getLastRealOrderId());
}
$total=$order->getGrandTotal()/2;
$order->setGrandTotal($total);
I know this is not the best way, but was experimenting to find the best way . How to achieve this? I plan to put the changed in a custom module. so not going to keep changes in core files. thanks
I had to do something similar recently and there were some big problems, but first the good news.
However,
One way that I didn't think of in time would be to have credit accounts for each customer. When a payment is less than the entire order add it to the account instead and leave the order unpaid for now. Allow arbitrary (pre)payments to the account. Once the account is great enough use it to pay the order, you might want to make a payment module for this bit.
Or it could work in reverse, pay all orders immediately and leave a negative balance in the credit account to be paid at a later date. I suspect this would be the least painful way of all.