Agence-DnD / PIMGento-2

PimGento2 is a Magento 2 extension that allows you to import your catalog from Akeneo CSV files into Magento 2.
Open Software License 3.0
65 stars 59 forks source link

Product URL rewrites not created when "Use Categories Path for Product URLs" is enabled #102

Open janbuelens opened 7 years ago

janbuelens commented 7 years ago

We have an issue with url rewrites after importing categories and products via Pimgento.

The url rewrites for the categories work fine, but the url-rewrites for the products are not ok.

When the setting "Use Categories Path for Product URLs" in "stores > configuration > catalog > Search Engine Optimization" is set to "Yes". There is no url rewrite created for the product.

An example: I have a category with the following url: https://my-site.com/root-category/sub-category.html

In this category there is a product with the url key "product-url". When I create the product in Magento, this is the url: https://my-site.com/root-category/sub-category/product-url.html But when the product is imported via Pimgento, there is no url rewrite created for the following url: https://my-site.com/catalog/product/view/id/4968/s/product-url/category/186/

Steps to reproduce:

We are using Magento EE2.1.6

magentix commented 7 years ago

Hi,

URL rewrites system has been improved by @spipu in pull #65

It seems developments can not use category in URLs. This fonctionnality is rarely used on Magento stores, because of duplicate content (product in severals categories give different URL fore same product).

So this fonctionnality is not in our roadmap, but maybe @spipu can work on it.

Regards, Matthieu

janbuelens commented 7 years ago

Hi,

Adding categories to the URL is default Magento functionality. When using this functionality and enabling the canonical tags, there is no duplicate content issue.

Isn't it possible to add this to the roadmap?

tdgroot commented 7 years ago

I agree with @janbuelens. This functionality is enabled by default in Magento. It won't cause duplicate content because Magento adds canonical tags to prevent this.

janbuelens commented 7 years ago

@magentix can we expect a patch for this issue? Sice this is default Magento behaviour, I think a fix for this issue should be added to the roadmap.

magentix commented 7 years ago

Hi,

We will work on it for add product URL key in rewrite.

torhoehn commented 6 years ago

@janbuelens So I created a product with the name "test" manually and got three redirects: /test.html -> catalog/product/view/id/199/category/4 /tvs-und-projectoren/test.html -> catalog/product/view/id/199/category/5 test.html -> catalog/product/view/id/119

So for each product you import you want to have three redirects, right?

janbuelens commented 6 years ago

@torhoehn yes, the same redirects should be created as when you create a product manually.

torhoehn commented 6 years ago

@janbuelens Okay, I'll have a closer look at this tomorrow.

torhoehn commented 6 years ago

@magentix @janbuelens What do you think about to use this solution? https://magento2-blog.com/magento-2-regenerate-url-rewrites/

janbuelens commented 6 years ago

@torhoehn this looks like a good solution