Closed artmouse closed 1 year ago
Hi @artmouse. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release@magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
Hi @engcom-November. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branch@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure. 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.Issue: Confirmed
once verification is complete. Hello @artmouse,
Thanks for the report and collaboration!
We have tried to reproduce the issue in 2.4-develop instance via the following link. https://experienceleague.adobe.com/docs/commerce-operations/configuration-guide/multi-sites/ms-admin.html
In order to reproduce this issue we have cretaed two store views, en
and de
and make de
as default store view.
We are able to get the expected result, for de
store there is no cookie but for en
store cookie is there, Please have a look at the scrreenshot below:
For de
store there is no cookie
Fot en
store cookie is visible with name store
Please let us know if we missed anything in order to reproduce the issue.
Thanks.
You didn't read the description carefully. Here the specific task is not to use store codes, but to use subdirectories instead. Main storeview /de/ Second storeview /
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. For this you can follow the below official documetnation provided by magento. https://experienceleague.adobe.com/docs/commerce-operations/configuration-guide/multi-sites/ms-admin.html
If you still want to setup store views in sub directories via following the below link : instruction
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.
https://github.com/magento/magento2/blob/35e8e434be0b21072382b3f91c71678efc0242c1/app/code/Magento/Store/Model/StoreSwitcher/ManageStoreCookie.php#L58-L71
But when try to delete the store cookie in $cookieMetadata set the path /de, but existing "store" cookie has path /.
https://github.com/magento/magento2/blob/35e8e434be0b21072382b3f91c71678efc0242c1/app/code/Magento/Store/Model/StoreCookieManager.php#L72-L78
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)
https://github.com/magento/magento2/blob/35e8e434be0b21072382b3f91c71678efc0242c1/app/code/Magento/Store/Model/Store.php#L1373-L1378
Actual result
Additional information
Similar problem: https://github.com/magento/magento2/issues/8509
Release note
No response
Triage and priority