Pergunta

Is it possible to remove product id from URL rewrite replacing it with another attribute, for example SKU?

From my brief research it seems that ID is added explicitly (line 749 of Mage_Catalog_Model_Url)

Has anyone tried to do this? Any drawbacks of doing so?

Foi útil?

Solução

The product ID usually gets added to the URL string when two products share the same URL Key. An easy way to check which products are conflicting is to take the ID off the end of a page and see which product loads. Once each product has a unique URL Key the product IDs will not get added to the end.

I would also export the product list with the URL Key and confirm that the product ID isn't defined in the URL Key. That would also be the easiest way to add the SKU to the URL Key if you really want it there. i.e. export the product list with URL Key, change the URL Key to use the SKU, import the modified list.

Outras dicas

When you need to have more control of what gets displayed in the URL, you can look at the urlrewrite section under the catalog menu in the back end.

You can specify very specific url's for any category/product that you would like to be displayed.

As @Greg said, make sure you have urlkey specified against the product in the back-end.

If this still does not work, and you still see the product ID showing up on the front end, then there might be a custom module causing it.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top