Magento2 I need to redirect to home page & display success msg after Submitting custom form in cart page.
I have written below code in my custom controller file but msg doesn't print on Home page only page gets redirect.
$this->messageManager->addSuccess( __("Thank you for submitting your product enquiry . Our team will reach out to you as soon as possible.") ); $resultRedirect = $this->resultRedirectFactory->create(); /** @return \Magento\Framework\Controller\Result\Redirect **/ return $resultRedirect->setPath('/');