Protected Member Functions | |
_preDispatchValidateCustomer ($redirect=true, $addErrors=true) |
Definition at line 31 of file Action.php.
Make sure customer is valid, if logged in By default will add error messages and redirect to customer edit form
bool | $redirect - stop dispatch and redirect? | |
bool | $addErrors - add error messages? |
Definition at line 41 of file Action.php.
00042 { 00043 $customer = Mage::getSingleton('customer/session')->getCustomer(); 00044 if ($customer && $customer->getId()) { 00045 $validationResult = $customer->validate(); 00046 if ((true !== $validationResult) && is_array($validationResult)) { 00047 if ($addErrors) { 00048 foreach ($validationResult as $error) { 00049 Mage::getSingleton('customer/session')->addError($error); 00050 } 00051 } 00052 if ($redirect) { 00053 $this->_redirect('customer/account/edit'); 00054 $this->setFlag('', self::FLAG_NO_DISPATCH, true); 00055 } 00056 return false; 00057 } 00058 } 00059 return true; 00060 }