4

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?

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.

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.

  • Unfortunately the problem remains in 2.2.0. Now we are waiting for 2.2.1. – George A.B. Oct 29 '17 at 16:41
  • The problem remains in 2.2.1 – George A.B. Nov 11 '17 at 15:04

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.