Magento 2 Plugin After Execute Controller
I have an existing controller that returns a JSON. public function execute() { $customer = $this->_customerModel->getById(175); $resultJson = $this->resultFactory->create(MagentoFrameworkControllerResultFactory::TYPE_JSON); $resultJson->setData( [ ‘status’ => ‘ok’, ‘message’ => ‘Success.’, ‘data’ => $customer->__toArray() ] ); return $resultJson; } I have created afterExecute() plugin,… Read More »Magento 2 Plugin After Execute Controller