1

I am trying to redirect the customer when their store view is not correct. When I redirect the _request method it is GET and I need it to be POST

  if ($currentStore !== $customerStore) {
       $params = $this->getRequest()->getParams();
       $url = $this->_url->setScope($customerStore)->getUrl('customer/account/loginPost', $this->getRequest()->getParams());
       $resultRedirect = $this->resultRedirectFactory->create();
       $resultRedirect->setUrl($url);
       return $resultRedirect;
   }
0

You can directly use like this.

$this->_redirect('customer/account/loginPost');

It will redirect there.

Hope it will help you.

0

Does something like this work

https://magento.stackexchange.com/a/241547/70343

$param = ['param1' => 'value1', 'param2' => 'value2'];
    $resultRedirect->setPath('frontname/path/controllername', ['params' => $params]);

Failing that you could look into a curl request. With curl you can post to a url with params.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.