I want to make some modification ,when discount is applied.But I am unable to find files which are responsible for applying discount in the checkout page.
I know that this frontend/base/default/template/checkout/total/default.phtml
is responsible for showing the discount title and value.And it uses functions like
$this->getTotal()->getTitle()
and $this->helper('checkout')->formatPrice($this->getTotal()->getValue()
.
All the above functions have multiple definitions and I am not able to find which file is used for getting the discount.It would be great help if somebody can explain ,that how discounts are applied .Whats the flow of files or modules used (like mage/sales & mage/checkout ) for it.