-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Magento 2.2 language switching not working on catalog and Product Pages #11963
Comments
Tested it on a clean Magento 2.2 installation with another store view configured and "Add Store Code to Urls" enabled. It works fine in "development" mode, but doesn't work in "production" mode. |
Hi Mhauri |
Hello @iWEBproject. Thanks for reporting. Would You please provide us detailed steps of how You set two store views. |
@iWEBproject, thank you for your report. |
The same problem here in fresh install of 2.2.1 with Stores > Configuration > Web > Url Options > Add Store Code to Urls = Yes. |
I have the same issue with 2.2.1 version. Hope a solution. |
I see that the issue is fixed on you website https://www.nuovamoda.fashion/el/papoutsia/mpotes.html. How can i fix it please? thank you in advance. |
Hi achatpc |
The same in 2.2.1, buth in production and developer modes. |
The issue occurs in these places:
Not completely sure if it should be the correct fix, but additional condition like
|
Thank you I will test it and provide feedback for you.
Have a nice day
Envoyé de mon iPhone
… Le 15 déc. 2017 à 23:11, Artem Klimov ***@***.***> a écrit :
The issue occurs in these places:
vendor/magento/module-catalog/Controller/Category/View.php
public function execute()
155: if ($this->_request->getParam(\Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED))
vendor/magento/module-catalog/Controller/Product/View.php
public function execute()
79: if ($this->getRequest()->isPost() && $this->getRequest()->getParam(self::PARAM_NAME_URL_ENCODED))
Not completely sure if it should be the correct fix, but additional condition like && !$this->getRequest()->getParam('___from_store') can resolve this issue
vendor/magento/module-catalog/Controller/Category/View.php
public function execute()
155: if ($this->_request->getParam(\Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED) && !$this->_request->getParam('___from_store')) {
vendor/magento/module-catalog/Controller/Product/View.php
public function execute()
79: if ($this->getRequest()->isPost() && $this->getRequest()->getParam(self::PARAM_NAME_URL_ENCODED) && !$this->getRequest()->getParam('___from_store')) {
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
hi @klimart thanks for the solution. i have implemented your solution in my magento 2.2.1 and it is not working. i have tested this solution on "default", "developer" and "production" mode as well. |
Hello @irfanMukhtar it's seems strange, as for me fix works in 2.2.2 version, but I don't observe any core code changes in these files from 2.2.0 version, so it should work for 2.2.1 and 2.2.0 too. |
Thanks a lot @klimart. I have implemented you patch in my magento 2.2 and it is working fine. Now language is switching on catalog and product page. Great work 👍 |
Can also confirm it works fine on 2.2-develop branch. |
Maybe this helps someone...
/home/www/nahrin/htdocs/vendor/magento/module-catalog/Controller/Category/View.php: Line 155
|
Hi klimart and Happy New Year |
2.2.2, the same. Applied klimart's patch but language not switched - page simply reloading to the same lang when "Add Store Code to Urls" is on. |
I also confirm the @klimart patch is working on 2.2.2. Thanks! |
@moleculech Tested with 2.2.1 and working fine in category and product put not working in catalog search result. |
I can also confirm this is a problem in 2.1.11 |
I can confirm the issue in 2.2.2 and also that the fix posted by @klimart and in the 13534 pr resolves the issue. I didn't test catalog search results prior to patching my site but I am able to use the language switcher properly on catalog search results (as well as category pages and product detail pages) after the patch. I really hope this makes it into 2.2.3 as it's a "big deal" IMO :) //anyone not successful with the patch here probably just needs to flush their caches/static-view/preprocessed files |
I can confirm the same issue on 2.1.12 and that the fix provided by #11963 (comment) has fixed the issue. Is there a backport planned for 2.1? Or another ticket tracking this? |
Hi, it seems to me that the above mentioned fix by @klimart does only work with products and categories that have the same URL key in both stores. Update Maybe worth noting: |
Hi, has this been backported to 2.1 already? |
Hi, I've created a backport for magento 2.1 |
Preconditions
Steps to reproduce
Expected result
Actual result
The text was updated successfully, but these errors were encountered: