i want to apply custom discount on grand total (without coupons) in create order section in magento admin.

i have added 2 lines code for check in this file app\code\core\Mage\Adminhtml\Block\Sales\Order\Create\Items\Grid.php

in function

public function getSubtotal()

        if ($this->displayTotalsIncludeTax()) {
            if ($address->getSubtotalInclTax()) {

                return $address->getSubtotalInclTax();


            return $address->getSubtotal()+$address->getTaxAmount();
        } else {
     $address->setDiscountDescription('Custom Discount');

     return $address->getSubtotal();
        return false;

but it is not only applied on subtotal of products not on grand total

see here output of applied code

Need help to find correct function.

  • what did u try? – Manashvi Birla Jun 12 '15 at 10:23
  • @Manashvibirla just added two lines $address->setDiscountAmount(-(400)); $address->setDiscountDescription('Custom Discount'); to check it. but it this $400 discount applied on subtotal only not on grand total . i think there is any other function to calculate grand total . – Ashvini Marwal Jun 12 '15 at 10:29
  • @AshviniMarwal Suppose if i want to enter discount price at order page how can i change.. Now your code looks like assigned discount order amount in code. i need change randomly so assigning discount amount in code is not a good idea. – zus Feb 5 '18 at 5:41

I have fixed. issue was in get price with tax.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.