Description
In the file ProductCategoryUniqueSlug.php, slug uniqueness is validated separately for products and categories. This allows a product and a category to have the same slug (url_key), which can cause routing issues, incorrect content resolution, or SEO conflicts on the storefront.
Steps to Reproduce:
Go to the admin panel.
Create a category with slug = summer-sale.
Create a product with url_key = summer-sale.
Visit /summer-sale on the frontend.
Routing conflicts or incorrect resolution occur — either the product or category will be served, not both.
Expected Behavior:
The slug (url_key) should be globally unique across both:
Product slugs (product_flat.url_key)
Category slugs (categories.slug)
This ensures:
No routing conflict
Predictable behavior on the frontend
SEO-friendly, canonical URL structure