Example #1
0
 /**
  * Delete the address selected
  * @return unknown_type
  */
 public function addressdeleteAction()
 {
     $id = $this->getRequest()->getParam('id');
     if (is_numeric($id)) {
         // Get the customer information before to delete the address
         $customer = Addresses::getCustomer($id);
         if (is_array($customer)) {
             try {
                 if (Addresses::delete_address($id)) {
                     $this->_helper->redirector('edit', 'customers', 'admin', array('id' => $customer['customer_id'], 'mex' => $this->translator->translate('The task requested has been executed successfully.'), 'status' => 'success'));
                 }
             } catch (Exception $e) {
                 $this->_helper->redirector('edit', 'customers', 'admin', array('id' => $customer['customer_id'], 'mex' => $this->translator->translate('Unable to process the request at this time.') . ": " . $e->getMessage(), 'status' => 'danger'));
             }
         }
     }
 }