Skip to content

#14674 Add ChangeStoreCode switcher to StoreSwither pool of swichers … #20851

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

Closed
wants to merge 2 commits into from
Closed

Conversation

vgerassimov
Copy link

@vgerassimov vgerassimov commented Jan 31, 2019

…that changes store code in redirect url from current store code to target store code

Description (*)

Issue started after deleting part of code responsible for replacing store codes in URL in this commit: 68a2605#diff-285a7e574ab3ef96f4df4d9b1d326428L144

Fixed Issues (if relevant)

  1. Language Switcher is not working on Magento 2.2.3 #14674: Language Switcher is not working on Magento 2.2.3

Manual testing scenarios (*)

  1. Enable web/url/use_store
  2. Go to any page of your multi-store website
  3. Switch scope using /stores/store/switch/?___store=<target_store_code>&___from_store=<current_store_code>&uenc=<base64encoded_reference_link>

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

…that changes store code in redirect url from current store code to target store code
@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Jan 31, 2019

CLA assistant check
All committers have signed the CLA.

@magento-engcom-team
Copy link
Contributor

Hi @vgerassimov. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@hostep
Copy link
Contributor

hostep commented Jan 31, 2019

@vgerassimov: does this fix the same issue as #19798 attempts to fix?

Also I'm not sure if doing a simple str_replace will be able to handle translated category or product url's?
For example, you can have a category with url 'cat-english.html' in an English storeview and 'cat-french.html' in a French storeview.
I don't think this solution is capable of handling that?

@vgerassimov
Copy link
Author

vgerassimov commented Jan 31, 2019 via email

@hostep
Copy link
Contributor

hostep commented Jan 31, 2019

Hi @vgerassimov

Can you help me out a little bit by explaining exactly what you are trying to achieve with this PR?
If I understand it correctly, you are talking about the store switcher (which appears in the footer) and not the store view switcher (which appears in the header), correct?
Issue #14674 talks about the storeview switcher btw, but that's not very important I think.

Here are steps I followed with some test cases:

  1. Setup Magento 2.3.0
  2. In admin: set Stores > Configuration > General > Web > Url Options > Add Store Code to Urls > Yes
  3. In admin: create a website/store/store view structure like this:
Website Store Store view
Main Website US Store (code: us) US Store View (code: en_us)
Main Website GB Store (code: gb) GB Store View (code: en_gb)
  1. In admin: create 2 categories, with the following properties:
Scope Name Url Key
All Store Views Cat 1 cat-1
All Store Views Cat 2 cat-2
US Store View Cat 2 US cat-2-us
GB Store View Cat 2 GB cat-2-gb
  1. Reindex & flush caches
  2. In the frontend, follow the following scenario's and look at the results:
Scenario Start page Switch to Store Expected Result Result in vanilla 2.3.0 Result from this PR
Homepage /en_us/ GB /en_gb/ /en_gb/ /en_gb/
Cat 1 /en_us/cat-1.html GB /en_gb/cat-1.html /en_gb/cat-1.html /en_gb/
Cat 2 /en_us/cat-2-us.html GB /en_gb/cat-2-gb.html /en_gb/cat-2-us.html /en_gb/

The results in bold are the ones which don't match the expected result.
So this PR seems to introduces more problems then it fixes.

If I'm mistaken in any of these steps, please let me know and I can re-test then. Thanks!

@slavvka slavvka self-assigned this Aug 8, 2019
@slavvka
Copy link
Member

slavvka commented Aug 8, 2019

@magento run all tests

@slavvka
Copy link
Member

slavvka commented Aug 8, 2019

Hey @vgerassimov Thank you for the contribution. Could you please review the comment #20851 (comment) because it seems that there are issues in your solution.

@vgerassimov
Copy link
Author

@slavvka Hello!

After upgrading to the latest magento versions this issue has been fixed, sorry for long answering, missed previous comment notification probably.

@vgerassimov vgerassimov closed this Aug 8, 2019
@m2-assistant
Copy link

m2-assistant bot commented Aug 8, 2019

Hi @vgerassimov, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@slavvka
Copy link
Member

slavvka commented Aug 13, 2019

Oh, Thank you for verification and for your efforts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants