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
Tax
AjaxDelete.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Tax\Controller\Adminhtml\Tax
;
8
9
use
Magento\Framework\Controller\ResultFactory
;
10
11
class
AjaxDelete
extends
\Magento\Tax\Controller\Adminhtml\Tax
12
{
19
public
function
execute
()
20
{
21
$classId = (int)$this->
getRequest
()->getParam(
'class_id'
);
22
try
{
23
$this->taxClassRepository->deleteById($classId);
24
$responseContent = [
'success'
=>
true
,
'error_message'
=>
''
];
25
}
catch
(\
Magento
\Framework\Exception\LocalizedException $e) {
26
$responseContent = [
'success'
=>
false
,
'error_message'
=> $e->getMessage()];
27
}
catch
(\Exception $e) {
28
$responseContent = [
29
'success'
=>
false
,
30
'error_message'
=>
__
(
'We can\'t delete this tax class right now.'
)
31
];
32
}
33
35
$resultJson = $this->resultFactory->create(
ResultFactory::TYPE_JSON
);
36
$resultJson->setData($responseContent);
37
return
$resultJson;
38
}
39
}
Magento\Framework\Controller\ResultFactory\TYPE_JSON
const TYPE_JSON
Definition:
ResultFactory.php:22
Magento\Framework\Controller\ResultFactory
Definition:
ResultFactory.php:17
Magento\Tax\Controller\Adminhtml\Tax\AjaxDelete
Definition:
AjaxDelete.php:11
__
__()
Definition:
__.php:13
Magento\Framework\App\Action\AbstractAction\getRequest
getRequest()
Definition:
AbstractAction.php:60
Magento\Framework\App\ActionInterface\execute
execute()
Magento\Tax\Controller\Adminhtml\Tax
Definition:
Tax.php:16
Magento
Magento\Tax\Controller\Adminhtml\Tax
Definition:
AjaxDelete.php:7