Sorry forgot to update this thread! Thanks Soren! I'll have to take a closeer look at IUrlService.
But fow now, since I only have 1 catalog, I was able to achieve what I needed by replacing the exising rules in UrlRewriting.config with the below and adding a bit of logic to my macros on the catalog.aspx & product.aspx pages.
Nicer Urls
Hi guys,
Apologies if this has already been answered. But I couldn't find it!
How do I remove the "/c-23" & "c-23/c-71/p-106", etc when viewing product pages?
I have Ucommerce 2.6.1 on Umbraco 4.7.1.
Cheers
I'm pretty sure that you can't...
uCommerce relies on these parameters to fetch the correct product and product catalog.
You might be able to do some advanced url rewriting but that would require unique catalog and product names.
/Michael
Thanks Michael. But I was hoping that would not be the answer!
I had a look at some of the links here http://www.ucommerce.dk/en/customers.aspx and they seem to have been able to achieve it?
You can take a look at the URL rewriting rules in /config/UrlRewriting.config file.
For example the default rule for products is:
I guess you could do some code that runs when you save a product and creates a new rewriting rule that would look something like:
That way when you hit http://yourdomain.com/yourcategory/yourproductname uCommerce would show you the product.
/Michael
Yep that works. But seems a little cumbersome to maintain for lots of products. Anyone else?
You can change the way URLs are generated by overriding the IUrlService.
Docs available at Nice URL with uCommerce.
Sorry forgot to update this thread! Thanks Soren! I'll have to take a closeer look at IUrlService.
But fow now, since I only have 1 catalog, I was able to achieve what I needed by replacing the exising rules in UrlRewriting.config with the below and adding a bit of logic to my macros on the catalog.aspx & product.aspx pages.
~/products/a-product/mellow-yellow
<add name="ProductsProductRewrite"
virtualUrl="(.*)/products/(.*)"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="~/products/product.aspx?catalog=c-23&product=$2"
ignoreCase="true"
xmlns="" />
<add name="ProductsRewrite"
virtualUrl="(.*)/products"
rewriteUrlParameter="ExcludeFromClientQueryString"
destinationUrl="~/products/catalog.aspx?catalog=c-23"
ignoreCase="true"
xmlns="" />
Thanks for being awesome and posting your soluton in the thread :)
No problem! I learn so much from these forums.
is working on a reply...