Public Member Functions | |
saveAction () | |
Protected Member Functions | |
_initAction () |
Definition at line 34 of file ClassController.php.
_initAction | ( | ) | [protected] |
Initialize action
Definition at line 77 of file ClassController.php.
00078 { 00079 $classType = strtolower($this->getRequest()->getParam('classType')); 00080 $this->loadLayout() 00081 ->_setActiveMenu('sales/tax/tax_classes_' . $classType) 00082 ->_addBreadcrumb(Mage::helper('tax')->__('Sales'), Mage::helper('tax')->__('Sales')) 00083 ->_addBreadcrumb(Mage::helper('tax')->__('Tax'), Mage::helper('tax')->__('Tax')) 00084 ; 00085 00086 return $this; 00087 }
saveAction | ( | ) |
save class action
Definition at line 40 of file ClassController.php.
00041 { 00042 if ($postData = $this->getRequest()->getPost()) { 00043 $model = Mage::getModel('tax/class') 00044 ->setData($postData); 00045 00046 try { 00047 $model->save(); 00048 $classId = $model->getId(); 00049 $classType = $model->getClassType(); 00050 $classUrl = '*/tax_class_' . strtolower($classType); 00051 00052 Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('tax')->__('Tax class was successfully saved')); 00053 $this->_redirect($classUrl); 00054 00055 return ; 00056 } 00057 catch (Mage_Core_Exception $e) { 00058 Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); 00059 Mage::getSingleton('adminhtml/session')->setClassData($postData); 00060 $this->_redirectReferer(); 00061 } 00062 catch (Exception $e) { 00063 Mage::getSingleton('adminhtml/session')->addError(Mage::helper('tax')->__('Error while saving this tax class. Please try again later.')); 00064 Mage::getSingleton('adminhtml/session')->setClassData($postData); 00065 $this->_redirectReferer(); 00066 } 00067 00068 $this->_redirectReferer(); 00069 } 00070 }