Hello forums !!
I am very new to the Magento E-commerce World and trying to explorer more and more in Magento.
Currently I am stuck with one problem that it need to be done in my first Magento Project.
I would like to know how this can be achieved, I am struggling with the problem from past 4-5 days.
I would like to add some extra amount say($2.5) to the total order amount and invoice amount.
Note: I would like to achieve this after the successful checkout i.e. when the user returns to the checkout success
page from the payment gateways(say after paying through paypal).
[It would be even better if we add some text like Surcharge Amount: $2.5 just above Grand Total section Block in Order details page and invoice details page(just in the same way as Shipping methods charge and tax amount are displayed), but not of much importance but if anybody knows then it’s obviously a plus point to know new things:).]
After searching I found some hints but don’t know whether they are 100% reliable or not.
1> Updating tax_amount = 2.5, base_tax_amount= 2.5 and updating the grand_total and base_grand_total field of table: sales_orders accordinly
But this approach is not good and also don’t know whether this method works perfectly or not.
2> overriding collectTotals() method of app/core/Mage/Sales/Models/Quote.php as like:
and saving like
$address->setGrandTotal($address->getGrandTotal() + 2.5);
$address->setBaseGrandTotal($address->getBaseGrandTotal() + 2.5);
I don’t know much about saving like this, Do this create new record or just updates with new value?
Please help how to achieve the solutions.
Any futher suggestions/hints would be great.
Thanks in advance.