22 $resultRedirect = $this->resultRedirectFactory->create();
24 $state = $this->
getRequest()->getParam(
'state');
25 $isDefault = $this->
getRequest()->getParam(
'is_default');
26 $visibleOnFront = $this->
getRequest()->getParam(
'visible_on_front');
30 $status->assignState($state, $isDefault, $visibleOnFront);
31 $this->messageManager->addSuccessMessage(
__(
'You assigned the order status.'));
32 return $resultRedirect->setPath(
'sales/*/');
34 $this->messageManager->addErrorMessage($e->getMessage());
35 }
catch (\Exception $e) {
36 $this->messageManager->addExceptionMessage(
38 __(
'Something went wrong while assigning the order status.')
42 $this->messageManager->addErrorMessage(
__(
'We can\'t find this order status.'));
44 return $resultRedirect->setPath(
'sales/*/assign');
46 return $resultRedirect->setPath(
'sales/*/');