0

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.

Tom Miller
  • 431
  • 1
  • 5
  • 16
  • 1
    I haven't used uCommerce, but in a regular Sitecore scenario I would be looking at using Wildcard items to replace the query strings, an `httpRequestBegin` pipeline processor to handle the incoming request and overriding the default `LinkManager` to handle generating the out going URLs. An alternative would be to look at URL rewriting (but I'm not sure that would work in this instance) – jammykam Nov 20 '15 at 16:15
  • @jammykam Thanks for the tip. Let me have a look into these. I'll update you to let you know how it goes. – Tom Miller Nov 22 '15 at 16:03

1 Answers1

1

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.

  • Thanks for this. It worked. Just out of interest.. I assume if you access Home/product or Home/category without passing in a wildcard item this resolves 404 not found? How did you achieve this? – Tom Miller Dec 02 '15 at 15:07