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-sales
Controller
Adminhtml
Order
Status
Unassign.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Sales\Controller\Adminhtml\Order\Status
;
8
9
use
Magento\Framework\App\Action\HttpPostActionInterface
;
10
11
class
Unassign
extends
\Magento\Sales\Controller\Adminhtml\Order\Status implements
HttpPostActionInterface
12
{
16
public
function
execute
()
17
{
18
$state = $this->
getRequest
()->getParam(
'state'
);
19
$status
= $this->
_initStatus
();
20
if
(
$status
) {
21
try
{
22
$status
->unassignState($state);
23
$this->messageManager->addSuccessMessage(
__
(
'You have unassigned the order status.'
));
24
}
catch
(\
Magento
\Framework\Exception\
LocalizedException
$e) {
25
$this->messageManager->addErrorMessage($e->getMessage());
26
}
catch
(\Exception $e) {
27
$this->messageManager->addExceptionMessage(
28
$e,
29
__
(
'Something went wrong while unassigning the order.'
)
30
);
31
}
32
}
else
{
33
$this->messageManager->addErrorMessage(
__
(
'We can\'t find this order status.'
));
34
}
36
$resultRedirect = $this->resultRedirectFactory->create();
37
return
$resultRedirect->setPath(
'sales/*/'
);
38
}
39
}
Magento\Framework\Exception\LocalizedException
Definition:
LocalizedException.php:17
Magento\Sales\Controller\Adminhtml\Order\Status\Unassign
Definition:
Unassign.php:11
__
__()
Definition:
__.php:13
Magento\Framework\App\Action\AbstractAction\getRequest
getRequest()
Definition:
AbstractAction.php:60
Magento\Sales\Controller\Adminhtml\Order\Status
Definition:
Assign.php:7
Magento\Framework\App\ActionInterface\execute
execute()
Magento\Sales\Controller\Adminhtml\Order\Status\_initStatus
_initStatus()
Definition:
Status.php:44
$status
$status
Definition:
order_status.php:8
Magento
Magento\Framework\App\Action\HttpPostActionInterface
Definition:
HttpPostActionInterface.php:16