Closed mortenbirkelund closed 2 years ago
Hmm. I seem a bit silly documenting all of these steps only to see afterwards that this is exactly what #49 is addressing. However it seems strange that you would have to know yourself which categories belongs to a storeview . If you run the command for a storeview, where the category is not included in, then the rewrite is still created. So you would have to know exactly which categories to create for each storeview.
@mortenbirkelund so basically you want to add the all
store option to the category command as well? And/or set it to the default?
Yes basically. Set it as the default or as an option depends, at least in my mind, on how it will work.
If it only creates the same rewrites that magento would also have done itself, then I think it should be default. But if it forcefully generates for all storeview regardless, then It would be better as an option.
What do you think?
I agree, it doesn't really matter which we pick, as long as it is consistent. I'm closing this issue in favor of #58 , which should fix this.
I think i have found a scenario where the module is not generating all urls rewrites correctly.
Create 2 Websites, 2 Stores and 2 storeviews.![image](https://user-images.githubusercontent.com/8955039/149025937-b8f573f9-1bbe-4feb-92da-b2d62216a825.png)
Set the 2 stores to be using the same root category.
Create a category, and change the scope to one of either storeviews before changing the url key.![image](https://user-images.githubusercontent.com/8955039/149026223-b0348cce-c101-436f-948a-c7cc8abd117b.png)
You should now have 2 url rewrites (and 1 url redirect, but that is not relevant. )![image](https://user-images.githubusercontent.com/8955039/149026816-06777f36-b903-40f7-92fa-d99b70b08952.png)
Regenerate category urls and see that only 1 of the 2 rewrites are properly created.![image](https://user-images.githubusercontent.com/8955039/149026482-57cbebab-7036-4e94-bc78-e4f9c50fc9fa.png)
Confirm by deleting both of the 2 rewrites, and regenerate them. Only the storeview that inherits from global, will have a url rewrite correctly generated.![image](https://user-images.githubusercontent.com/8955039/149026898-17e13122-56c4-4b46-89ae-9eaeed3cad93.png)