Search code examples
sitecoresitecore8umbraco-ucommerce

Implementing SEO friendly URL's in uCommerce for Sitecore


I'm wondering whether anyone has come across the following issue. We're currently working on a Sitecore website that uses integrated uCommerce to provide eCommerce functionalty.

Rather than passing category and product ids to a static url that maps directly to an item in the sitecore content tree e.g.

  • domain.com/category/?category=123
  • domain.com/category/product/?product=321

We want to be able to have URL's like follows:

  • domain.com/category-name/product-name

Generating this url shouldn't be too difficult if we use IUrlService provided by uCommerce.

Is there an easy solution to get these sort of URL's to map to a particular item in the Sitecore content tree and ensure the uCommerce context is updated accordingly?

Thanks in advance for any help received.


Solution

  • I am using the Sitecore Commerce Connect framework and am using wildcard URLs for my products and categories. Since my products often appear in several categories, I have kept the structure of having separate URLs for products and categories to make sure that the URL for the product is not repeated if it appears under several categories.

    • Home/product/* is my the wildcard item for products
    • Home/category/* is the wildcard item for my categories

    The wildcard manager will then allow me to render the product and category pages based on those pages where I just resolve the item in Commerce connect by the information provided in the URL.

    The custom LinkManager will then provide the references to the correct URL when fetching a link for and item and it will not risk having the URL changed if I do changes to the category structure or add it in several categories.