18 $addressId = $this->
getRequest()->getParam(
'id',
false);
20 if ($addressId && $this->_formKeyValidator->validate($this->getRequest())) {
22 $address = $this->_addressRepository->getById($addressId);
24 $this->_addressRepository->deleteById($addressId);
25 $this->messageManager->addSuccess(
__(
'You deleted the address.'));
27 $this->messageManager->addError(
__(
'We can\'t delete the address right now.'));
29 }
catch (\Exception $other) {
30 $this->messageManager->addException($other,
__(
'We can\'t delete the address right now.'));
33 return $this->resultRedirectFactory->create()->setPath(
'*/*/index');