*/ class Mage_Sales_Model_Resource_Quote_Address_Attribute_Frontend_Discount extends Mage_Sales_Model_Resource_Quote_Address_Attribute_Frontend { /** * Fetch discount * * @param Mage_Sales_Model_Quote_Address $address * @return Mage_Sales_Model_Resource_Quote_Address_Attribute_Frontend_Discount */ public function fetchTotals(Mage_Sales_Model_Quote_Address $address) { $amount = $address->getDiscountAmount(); if ($amount != 0) { $title = Mage::helper('sales')->__('Discount'); $couponCode = $address->getQuote()->getCouponCode(); if (strlen($couponCode)) { $title .= sprintf(' (%s)', $couponCode); } $address->addTotal(array( 'code' => 'discount', 'title' => $title, 'value' => -$amount )); } return $this; } }