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

Wrong product URL rewrites in Multistore setting #135

Open
mtjweb opened this issue Aug 5, 2020 · 2 comments
Open

Wrong product URL rewrites in Multistore setting #135

mtjweb opened this issue Aug 5, 2020 · 2 comments
Assignees
Labels

Comments

@mtjweb
Copy link

mtjweb commented Aug 5, 2020

Describe the bug
The generated URL's are generated from the default product name instead of the name in the scope.

Expected behavior
Correct URL generated from the product name in the scope.

To Reproduce
Use the command "php bin/magento ok:urlrewrites:regenerate" to generate new URL's.
Check the products in the frontend, they are useing the default URL rewrite
Check the URL-key when editing a product in, there you see the correct URL rewrite
Check the url_rewrite table, the URL-keys are not in the table. Just the default URL rewrites.

Magento version 2.3.5-p1
Module version 1.5.6

@mvenghaus
Copy link

I had the same problem.

Add setStoreId to categoryCollection

Model/RegenerateCategoryRewrites.php:253
$categoriesCollection->addAttributeToSelect('name')
->setStoreId($storeId)

@mvenghaus
Copy link

I solved it by adding 2 lines. And before generating, I also had to set the following setting. I don't use the cli command so it was no problem to set the setting.

$this->regenerateCategoryRewrites->regenerateOptions['noRegenUrlKey'] = true;

Here's my patch:
https://gist.github.com/mvenghaus/1aba55b6fb6965fadd42c594414c9f88

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

No branches or pull requests

3 participants