Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-tax
Controller
Adminhtml
Rate
AjaxDelete.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Tax\Controller\Adminhtml\Rate
;
8
9
use
Magento\Framework\Controller\ResultFactory
;
10
11
class
AjaxDelete
extends
\Magento\Tax\Controller\Adminhtml\Rate
12
{
18
public
function
execute
()
19
{
20
$rateId = (int)$this->
getRequest
()->getParam(
'tax_calculation_rate_id'
);
21
try
{
22
$this->_taxRateRepository->deleteById($rateId);
23
$responseContent = [
'success'
=>
true
,
'error_message'
=>
''
];
24
}
catch
(\
Magento
\Framework\Exception\LocalizedException $e) {
25
$responseContent = [
'success'
=>
false
,
'error_message'
=> $e->getMessage()];
26
}
catch
(\Exception $e) {
27
$responseContent = [
28
'success'
=>
false
,
29
'error_message'
=>
__
(
'We can\'t delete this tax rate right now.'
)
30
];
31
}
32
34
$resultJson = $this->resultFactory->create(
ResultFactory::TYPE_JSON
);
35
$resultJson->setData($responseContent);
36
return
$resultJson;
37
}
38
}
Magento\Framework\Controller\ResultFactory\TYPE_JSON
const TYPE_JSON
Definition:
ResultFactory.php:22
Magento\Framework\Controller\ResultFactory
Definition:
ResultFactory.php:17
__
__()
Definition:
__.php:13
Magento\Tax\Controller\Adminhtml\Rate\AjaxDelete
Definition:
AjaxDelete.php:11
Magento\Framework\App\Action\AbstractAction\getRequest
getRequest()
Definition:
AbstractAction.php:60
Magento\Framework\App\ActionInterface\execute
execute()
Magento\Tax\Controller\Adminhtml\Rate
Definition:
Rate.php:16
Magento
Magento\Tax\Controller\Adminhtml\Rate
Definition:
Add.php:7