Skip to content
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

Adjusted locale switcher for internal shop pages without translations #2261

Merged
merged 4 commits into from
May 4, 2023

Conversation

BlackbitDevs
Copy link
Contributor

@BlackbitDevs BlackbitDevs commented Apr 26, 2023

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no

Existing locale switcher doesn't change locale for static route pages such as /shop/login, /shop/cart, /shop/customer/profile etc. This happens because $document in

public function getLocalizedLinks(Document $document): array
relates to the document whose leftmost path matches the current URL. When you only have /shop as document but the remaining CoreShop pages are handled via static routes, even a request for /shop/login will have $document = /shop. Of course this document may have translations and so the wrong links get created.

This PR checks if a static route has been used for current request. In this case links for this static route (but for other locale) will get created. This avoids having to add all internal shop pages as Pimcore Documents.

@BlackbitDevs BlackbitDevs marked this pull request as ready for review April 26, 2023 12:54
@dpfaffenbauer dpfaffenbauer merged commit 36af629 into coreshop:3.0 May 4, 2023
207 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants