Mage_Giftcert_Model_Entity_Quote_Address_Attribute_Backend_Giftcert Class Reference

Inheritance diagram for Mage_Giftcert_Model_Entity_Quote_Address_Attribute_Backend_Giftcert:

Mage_Sales_Model_Entity_Quote_Address_Attribute_Backend Mage_Eav_Model_Entity_Attribute_Backend_Abstract Mage_Eav_Model_Entity_Attribute_Backend_Interface

List of all members.

Public Member Functions

 collectTotals (Mage_Sales_Model_Quote_Address $address)


Detailed Description

Definition at line 28 of file Giftcert.php.


Member Function Documentation

collectTotals ( Mage_Sales_Model_Quote_Address address  ) 

Reimplemented from Mage_Sales_Model_Entity_Quote_Address_Attribute_Backend.

Definition at line 31 of file Giftcert.php.

00032     {
00033         $gift = Mage::getResourceModel('sales/giftcert')->getGiftcertByCode($address->getGiftcertCode());
00034         if ($gift) {
00035             $address->setGiftcertAmount(min($address->getGrandTotal(), $gift['balance_amount']));
00036         } else {
00037             $address->setGiftcertAmount(0);
00038         }
00039         
00040         $address->setGrandTotal($address->getGrandTotal() - $address->getGiftcertAmount());
00041         
00042         return $this;
00043     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:12 2009 for Magento by  doxygen 1.5.8