magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.51k stars 9.31k forks source link

Magento 2.2 wrong product url with multiple store views #16134

Closed LouNik1984 closed 5 years ago

LouNik1984 commented 6 years ago

Summary

Magento 2.2.2 with one website, one store and 2 store views. On frontend:

Preconditions

Steps to reproduce

Expected result

Actual result

Clean and flush cache + reindexing from cli does not help, issue persists.

I also tried to revert back product url suffix to default. At first glance it didn't do any change but if I save the product manually, the url gets correctly rewritten. What I mean by manually is:

Note: I don't care much about the checkboxes but I'm concerned about the url situation. We cannot go online with the website until the product urls are ok so this is really a big big issue.

LouNik1984 commented 6 years ago

Just to add:

I also tried to enable the store codes so maybe this would help the rewrite procedure but it doesn't do anything: the store code is correctly added to the url, but the url itself doesn't change, so now correct urls are like "www.domain.com/code/url-of-the-product.html" while wrong urls are like "www.domain.com/code/catalog/product/view/id/1713/s/product-url-key/category/6/"

ghost commented 6 years ago

Hi @LouNik1984 When i flush cache in admin (system-> cache management) urls was right, however the error in cli it not right, and the fix for this issue is already available in the 2.3-develop branch, so we've acknowledged the issue and added to our backlog.

maxchen666 commented 6 years ago

@engcom-backlog-nazar May I know the number of change list in 2.3-develop?

magento-engcom-team commented 5 years ago

Hi @engcom-backlog-nazar. Thank you for working on this issue. Looks like this issue is already verified and confirmed. But if your want to validate it one more time, please, go though the following instruction:

ghost commented 5 years ago

Hi @LouNik1984 The issue was re-tested and we can confirm that it was fixed on the 2.3 release branch. We closing this issue as fixed due to upcoming 2.3 release that will be available soon.

dipak85shinde commented 5 years ago

I am still facing this issue for categories on Magento 2.3.1. Categories URLs are generated correctly for the default store but not for the new store.

bobemoe commented 5 years ago

Yeah I'm still seeing this on 2.3.1 too, kind of.

If I create the category in the admin then the URL Rewrites are generated correctly.

However if I create the category programmatically, then the rewrite is only generated for the default store view, and the other store views have .../view/id/... style URL.

I wonder if its an error in my code? Do I need to trigger the generation of rewrites? Shouldn't creating the category be enough?

    $category = $this->_objectManager->get('\Magento\Catalog\Model\CategoryFactory')->create();
    $category->setName($name);
    $category->setParentId($parent_id); 
    $category->setIsActive(true);
    $this->_objectManager->get('\Magento\CatalogApi\CategoryRepositoryInterface')->save($category);
Layer5-PaulC commented 5 years ago

I also see this issue in 2.3.2 with programmatically created products (via CLI script), only the default store view has an seo-friendly product url. Did you find the correct modification to your script? It's wasteful of resources, but you might have to foreach over your storeviews, setStoreId($storeviewid), and repeatedly save your category?

bobemoe commented 5 years ago

Kind of a workaround but I ended up using olegkoval/magento2-regenerate-url-rewrites to fix the issues.

angelflo commented 5 years ago

same for me , this is issue is still here on 2.3.2 version

Layer5-PaulC commented 5 years ago

I can confirm olegkoval/magento2-regenerate-url-rewrites sorted it for me too, obviously I have to schedule the running of that, but I found running it against products for a whole store-view cleaned it up straight away.

SewHappy58 commented 4 years ago

Still having the same problem on Magento 2.3.4

gabriel3iri commented 4 years ago

I can confirm this is still an issue on 2.3.4

stijnkuppens commented 4 years ago

confirm still an issue.

angelflo commented 4 years ago

confirm also ... still the issue ! how is it possible to have a so major bug not solved since a SO LONG TIME ????

Bistrica420 commented 4 years ago

Confirmed this is still an issue....how is possible since so long time still a bug?