Say I have product in category "walking", which I relate to a product in category "seating". How do I get the link for the related product in seating, when I'm on the walking-product page?
The first method doesn't give me the entire url, it misses the category and thereby results in an "page not found" url.
The second method requires the categoryName, but since i'm standing on a walking product and try to do: umb:RequestQueryString('category') - I get the current category (walking), and not the category of the related product.
Get related product URL from another category
Hey guys,
So I have these products, which I want to relate to each other. This works great, except getting the right URL for each related product.
There are to methods to get a product url:
http://www.ucommerce.dk/docs/html/M_UCommerce_Xslt_CatalogLibrary_GetNiceUrlForProduct.htm
http://www.ucommerce.dk/docs/html/M_UCommerce_Xslt_Library_GetNiceUrlForProduct_1.htm
Say I have product in category "walking", which I relate to a product in category "seating". How do I get the link for the related product in seating, when I'm on the walking-product page?
The first method doesn't give me the entire url, it misses the category and thereby results in an "page not found" url.
The second method requires the categoryName, but since i'm standing on a walking product and try to do: umb:RequestQueryString('category') - I get the current category (walking), and not the category of the related product.
The XML for a related product is:
I guess that if the related product had a property like this: category="theCategoryName", I would be able to retrieve the correct URL.
Any suggestions?
Br,
Dan
In razor i would take the relatedProducts categories, and pick one of them (FirstOrDefault or alike).
Im not sure how you would do that in XSLT
(i assume you want XSLT when you mention XML)
Thats correct, Nikolaj - I need a way to do it in XSLT :)
I don't know exactly how to do it in xslt since i'm not using xslt.
But the way in xslt should be the same as in razor:
I think the xslt extension or the xslt library will have a method which you can use for that.
With my little xslt knowledge i would go like:
Hopefully that get's you in the right direction
Hey David, I'll try and look into your suggestions! :) Thanks so far!
is working on a reply...