-
Notifications
You must be signed in to change notification settings - Fork 26
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
Ignore Not Visible Products #31
Comments
Hi @sprankhub Thanks for the feedback. I'm not really in favor of this because once you put a product to visible and it has an incorrect url_key it will generate an incorrect url rewrite. |
That is indeed a fair point. However, if you have a lot of configurable products, where the simple products are usually not visible individually, this can lead to a lot of false positives. Yes, theoretically, the URL key should be unique. However, after migrating from M1 or importing data from other systems, they may also be the same. Do you think it would make sense to have an option for that? |
Ah, a configurable with simples, that didn't come to mind yet, thanks for the clarification! But I'll see what we can do with an extra option. Thanks for the suggestion! |
In theory, you are right. In practice, M1 had the same URL key for all simple products assigned to a configurable product. Hence, if you simply migrate the M1 data (e.g. via the data migration tool), which is not unusual, you'll exactly get that issue. Thanks! |
Hey @sprankhub This is now available in version 1.4.0 of this module, you can configure this using: An added benefit of this, is that it makes the product url checkers a lot faster and uses fewer memory, if you have a lot of invisible products on your shop. Thanks for the suggestion! |
Thanks, @hostep! Awesome! |
Actually, you can create the products in the backoffice with same url key. When creating the variants for the configurable products, then they will all get a different name (and thereby also a different url, key). However, if you decide to rename all the variants to the same name before saving, then they will all also get the same url key. IMO it is a strange decision to give all your variants the same name, but none the less, we actually had a customer who decided to do just that. So it means that it is not only happening when migrating from M1, but can also happen when working in M2. Thanks for the new setting @hostep and thanks @sprankhub for debugging and raising the issue. |
First, thanks a lot for this useful tool!
Shouldn't we ignore products, which are set to "Not Visible Individually" in the
catalog:product:integrity:urlkey
command? The reason is that these products are ignored when catalog URL rewrites are generated, see\Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator::generate
. Hence, I think we need to add->addAttributeToFilter('visibility', ['neq' => Visibility::VISIBILITY_NOT_VISIBLE])
here:magento2-module-url-data-integrity-checker/Checker/Catalog/Product/UrlKey/DuplicateUrlKey.php
Lines 79 to 88 in 654800a
Does that make sense to you?
The text was updated successfully, but these errors were encountered: