This tutorial is a solution if your store switcher is not working when customer is logged in Magento.
It happens because there is a difference between 2.3-develop and 2.3.3 for the di.xml file of the store module.
Check the following changes to resolve this issue :
First of all override the following file :
1 |
magento2/app/code/Magento/Store/etc/di.xml |
& Replace the following code :
1 2 3 4 5 6 7 8 9 10 |
<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> |
With
1 2 3 4 5 6 7 8 9 |
<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> </argument> </arguments> </type> |
We deleted the following line and the store switcher started working for logged in customers.
1 |
<item name="hashGenerator" xsi:type="object">Magento\Store\Model\StoreSwitcher\HashGenerator</item> |
Please let us know if this article is helpful to you or not.
[crayon-63d98413c7215964660857/] Using above fucntion Images can be imported directly from...
Override view block using di.xml and add the below code...
You can check a list of called layout XML for...
Follow the below steps to install and set up PWA...
If you want to remove all leading zero's from order,...
Let our Magento expert connect to discuss your requirement.
We offer Magento
certified developers.
Our Magento clientele
is 500+.
We sign NDA for the
security of your projects.
We’ve performed 100+
Magento migration projects.
Free quotation
on your project.
Three months warranty on
code developed by us.