Public Member Functions | |
getFormHtml (Varien_Object $entity, $entityType='quote') | |
getItems () | |
Protected Member Functions | |
_getGiftmessageSaveModel () |
Definition at line 35 of file Giftmessage.php.
_getGiftmessageSaveModel | ( | ) | [protected] |
Retrieve gift message save model
Definition at line 83 of file Giftmessage.php.
00084 { 00085 return Mage::getSingleton('adminhtml/giftmessage_save'); 00086 }
getFormHtml | ( | Varien_Object $ | entity, | |
$ | entityType = 'quote' | |||
) |
Generate form for editing of gift message for entity
Varien_Object | $entity | |
string | $entityType |
Definition at line 44 of file Giftmessage.php.
00044 { 00045 return $this->getLayout()->createBlock( 00046 'adminhtml/sales_order_create_giftmessage_form' 00047 )->setEntity($entity)->setEntityType($entityType)->toHtml(); 00048 }
getItems | ( | ) |
Retrive items allowed for gift messages.
If no items available return false.
Definition at line 57 of file Giftmessage.php.
00058 { 00059 $items = array(); 00060 $allItems = $this->getQuote()->getAllItems(); 00061 00062 foreach ($allItems as $item) { 00063 if($this->_getGiftmessageSaveModel()->getIsAllowedQuoteItem($item) 00064 && $this->helper('giftmessage/message')->getIsMessagesAvailable('item', 00065 $item, $this->getStore())) { 00066 // if item allowed 00067 $items[] = $item; 00068 } 00069 } 00070 00071 if(sizeof($items)) { 00072 return $items; 00073 } 00074 00075 return false; 00076 }