magento2-regenerate_url_rewrites
magento2-regenerate_url_rewrites copied to clipboard
Wrong product URL rewrites in Multistore setting
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
I had the same problem.
Add setStoreId to categoryCollection
Model/RegenerateCategoryRewrites.php:253 $categoriesCollection->addAttributeToSelect('name') ->setStoreId($storeId)
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