-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
No ability to switch Store View. Store cookie not deleted for default store views with multistore setup. #37666
Comments
Hi @artmouse. Thank you for your report.
Join Magento Community Engineering Slack and ask your questions in #github channel. |
Hi @engcom-November. Thank you for working on this issue.
|
Hello @artmouse, Thanks for the report and collaboration! We have tried to reproduce the issue in 2.4-develop instance via the following link. In order to reproduce this issue we have cretaed two store views, Fot Please let us know if we missed anything in order to reproduce the issue. Thanks. |
You didn't read the description carefully. |
Hello @artmouse, Thank you for your quick response! As I can understand with the main desription, you need to setup multistore/multiwebsite in your magento instance. If you still want to setup store views in sub directories via following the below link : You need to provide us the use case for the same. Thank you. |
Hello @artmouse, We have noticed that this issue has not been updated since long time. Hence we assume that the issue is fixed now, so we are closing it. Please feel free to raise a new one or reopen this issue if you need more assistance. Thanks. |
Preconditions and environment
A vanilla installation of Magento 2.4.6-p1 with default settings.
Stores and Web Site Configuration:
Web Site information:
Store information:
Steps to reproduce
Add second Store View and change the values of the main Store View for clarity
English Store View (default) information:
German Store View information:
For the German store, you need to create a subdirectory in the pub, so that it can be accessed at /de/ and assign a proper URL.
For Static and Media View Files, you will need to globally change the URL to something like this: https//domain.com/static/(media/) so that the styles would be available in /de/ as well.
Specify a URL for the German store with the prefix /de/.
Change the main Store View for Store to German. (make it default)
Going to the site...
Expected result
There is no "store" cookie for the primary Store View.
When the primary Store View (de) is located on the /de/ path and when you switch to another Store View (en) that is located on the / path, the "store" cookie is set for the target Store View (en).
And when switching from another Store View (en) when the "store" cookie is already set, it checks to match the target Store View ID with the default Store View ID.
If there is a match, the "store" cookie should be removed.
magento2/app/code/Magento/Store/Model/StoreSwitcher/ManageStoreCookie.php
Lines 58 to 71 in 35e8e43
But when try to delete the store cookie in $cookieMetadata set the path /de, but existing "store" cookie has path /.
magento2/app/code/Magento/Store/Model/StoreCookieManager.php
Lines 72 to 78 in 35e8e43
getStorePath() returns /de, but the "store" cookie has a path / - perhaps because of this the "store" en cookie is not deleted and the site always stays on Store View (en)
magento2/app/code/Magento/Store/Model/Store.php
Lines 1373 to 1378 in 35e8e43
Actual result
Additional information
Similar problem: #8509
Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: