5

Preconditions:

  • Magento 2.2
  • With 2 store views ( default and en )

Steps to reproduce:

  • Load home page: url = myeshop.com/
  • Switch store view: url = myeshop.com/?___store=en
  • Switch again store view: url = myeshop.com/?___store=en?___store=default

Result:

  • There has been an error processing your request

When I set "Add Store Code to URL" to 'Yes' in Stores> Configuration> General> Web it works properly. But it is not accepted.

Previously, at 2.1.9 the url remained the same after any store view switch.

Any advice?

asked Oct 10, 2017 at 4:03
1

2 Answers 2

1

I solve the same problem with a pice of Javascript code:

define([
 "jquery"
 ],
 function ($) {
 "use strict";
 $('a[data-post*="?___store=en?___store=tr"]').each(function(){
 var $link = $(this);
 var post = $link.attr('data-post');
 $link.attr('data-post', post.replace('?___store=en?___store=tr', '?___store=tr'));
 });
 $('a[data-post*="?___store=tr?___store=en"]').each(function(){
 var $link = $(this);
 var post = $link.attr('data-post');
 $link.attr('data-post', post.replace('?___store=tr?___store=en', '?___store=en'));
 });
 }
);

But I know that this is not the right approach.

Any other advice?

Thanks.

answered Oct 29, 2017 at 8:13
1

This problem has been reported and discussed here : https://github.com/magento/magento2/issues/10908

And the bug has been fixed here : https://github.com/magento/magento2/pull/11337

I guess it will be automatically fixed with the next release of Magento 2.2.

answered Oct 29, 2017 at 15:15
2
  • Unfortunately the problem remains in 2.2.0. Now we are waiting for 2.2.1. Commented Oct 29, 2017 at 16:41
  • The problem remains in 2.2.1 Commented Nov 11, 2017 at 15:04

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.