3

I have created 3 store for example:

  1. Australia
  2. India
  3. USA

and created related store view as show below: enter image description here

In my case if any customer is register from any store or store view. They are successfully register from any store/storeview. and successfully login from any store/storeview but after login from any store/storeview when user click on store/storeview switcher it's will not working. In admin setting I have done

  1. Add Store Code to Urls to Yes
  2. Customer Share to "Globe"

Now problem is that I am able to login from any store/storeview but not able to switch from one store to another store after login, without login it's successfully working.

enter image description here

Anyone is able to help me for solve this issue.

enter image description here

  • Can you please check your URL after changing store and before it ? – Kishan Savaliya Oct 18 at 6:14
  • I can see that before clicking on AU or IN, you have URL with base_url/magento2/ and in next image magento2 is missing I believe. – Kishan Savaliya Oct 18 at 6:15
  • Yes, My URL is base_url/magento2/ but after login when customer switch to store it's going to wrong url even without login it's working proper. – Sangeeta Chandaliya Oct 18 at 6:21
  • Hmmm, that's ODD – Kishan Savaliya Oct 18 at 6:24
  • Let me check if I can able to find some solution for you then, will let you know after some research.. – Kishan Savaliya Oct 18 at 6:24
3

After lot's of debug found that This issue in Magento 2.3.3 Default version.

In order to prevent this bug on 2.3.3, you need to update "vendor\magento\module-store\etc or override :

magento2/app/code/Magento/Store/etc/di.xml and comment to hashGenerator then the store switcher works for logged in customers.

Before

<type name="Magento\Store\Model\StoreSwitcher">
        <arguments>
            <argument name="storeSwitchers" xsi:type="array">
                <item name="cleanTargetUrl" xsi:type="object">Magento\Store\Model\StoreSwitcher\CleanTargetUrl</item>
                <item name="manageStoreCookie" xsi:type="object">Magento\Store\Model\StoreSwitcher\ManageStoreCookie</item>
                <item name="managePrivateContent" xsi:type="object">Magento\Store\Model\StoreSwitcher\ManagePrivateContent</item>
              <item name="hashGenerator" xsi:type="object">Magento\Store\Model\StoreSwitcher\HashGenerator</item>
            </argument>
        </arguments>
    </type>

After:

<type name="Magento\Store\Model\StoreSwitcher">
            <arguments>
                <argument name="storeSwitchers" xsi:type="array">
                    <item name="cleanTargetUrl" xsi:type="object">Magento\Store\Model\StoreSwitcher\CleanTargetUrl</item>
                    <item name="manageStoreCookie" xsi:type="object">Magento\Store\Model\StoreSwitcher\ManageStoreCookie</item>
                    <item name="managePrivateContent" xsi:type="object">Magento\Store\Model\StoreSwitcher\ManagePrivateContent</item>
                    <!-- <item name="hashGenerator" xsi:type="object">Magento\Store\Model\StoreSwitcher\HashGenerator</item> -->
                </argument>
            </arguments>
        </type>

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.