Public Member Functions | |
saveAction () | |
Protected Member Functions | |
_construct () | |
_getGiftmessageSaveModel () |
Definition at line 35 of file GiftmessageController.php.
_construct | ( | ) | [protected] |
Additional initialization
Reimplemented from Mage_Core_Controller_Varien_Action.
Definition at line 41 of file GiftmessageController.php.
00042 { 00043 $this->setUsedModuleName('Mage_Sales'); 00044 }
_getGiftmessageSaveModel | ( | ) | [protected] |
Retrieve gift message save model
Definition at line 74 of file GiftmessageController.php.
00075 { 00076 return Mage::getSingleton('adminhtml/giftmessage_save'); 00077 }
saveAction | ( | ) |
Definition at line 46 of file GiftmessageController.php.
00047 { 00048 try { 00049 $this->_getGiftmessageSaveModel() 00050 ->setGiftmessages($this->getRequest()->getParam('giftmessage')) 00051 ->saveAllInOrder(); 00052 } catch (Mage_Core_Exception $e) { 00053 $this->_getSession()->addError($e->getMessage()); 00054 } catch (Exception $e) { 00055 $this->_getSession()->addError(Mage::helper('giftmessage')->__('Error while saving gift message')); 00056 } 00057 00058 if($this->getRequest()->getParam('type')=='order_item') { 00059 $this->getResponse()->setBody( 00060 $this->_getGiftmessageSaveModel()->getSaved() ? 'YES' : 'NO' 00061 ); 00062 } else { 00063 $this->getResponse()->setBody( 00064 Mage::helper('giftmessage')->__('Gift message has been successfully saved') 00065 ); 00066 } 00067 }