21 if ($rateId = $this->
getRequest()->getParam(
'rate')) {
25 $this->_taxRateRepository->deleteById($rateId);
27 $this->messageManager->addSuccess(
__(
'You deleted the tax rate.'));
28 return $resultRedirect->setPath(
"*/*/");
30 $this->messageManager->addError(
31 __(
'We can\'t delete this rate because of an incorrect rate ID.')
33 return $resultRedirect->setPath(
"tax/*/");
34 }
catch (\
Magento\Framework\Exception\LocalizedException $e) {
35 $this->messageManager->addError($e->getMessage());
36 }
catch (\Exception $e) {
37 $this->messageManager->addError(
__(
'Something went wrong deleting this rate.'));
40 if ($this->
getRequest()->getServer(
'HTTP_REFERER')) {
41 $resultRedirect->setRefererUrl();
43 $resultRedirect->setPath(
"*/*/");
45 return $resultRedirect;