I am trying add code for redirect $this->resultRedirect->setPath('checkout/index/index#payment');

but some reason its take slash at the end of url so url become www.demo.com/checkout/index/index#payment/

which give me 404. if I pass www.demo.com/checkout/index/index#payment it work.

in-short I am getting addition slash at the end after parameter.

  • You might be getting JS error
    – Amit Bera
    Commented Sep 12, 2018 at 11:06
  • @AmitBera No there is not any error as data is already pre-set in quote but i am getting 404 due to / at last www.demo.com/checkout/index/index#payment/
    – Kul
    Commented Sep 12, 2018 at 11:08

1 Answer 1


Below code worked for me

 $this->_redirect('checkout', ['_fragment' => 'payment']);
  • Thank you Hitesh, this solved my same problem. One related thing though, is there a way to send an error message to the checkout/#payment? Tried with the MessageManager but doesn't do anything. Commented Nov 3, 2023 at 12:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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