Page 1 of 1

Add link to different product in current product description

Posted: Wed May 20, 2009 8:10 am
by ZLA
Say I have a Three Legged Stool product where I want the description to say something like: "If you need stronger support, consider our Four Legged Stool" where Four Legged Stool links to http://www.myStore.com/Four-Legged-Stool-P123.aspx.

1. Is there any quick way on the admin side to see a product's basic URL? Has anyone modified Edit Product to display that?

2. What is the best way to embed this in the description? I know I can code the html directly but are nVelocity variables available in the Product Description field? My main concern is absolute vs. relative paths. For example, if I have http://www.MyStore.com and test.MyStore.com, the root link is different and shouldn't be hard-coded.

Thanks for the help.

Re: Add link to different product in current product description

Posted: Wed May 20, 2009 8:26 am
by mazhar
If you want NVelocity to build this URL then you can use $store.StoreUrl and $product.ProdcutUrl to build a proper link to product page. From EditProduct see the Preview menu item, it will give you complete product link.

Re: Add link to different product in current product description

Posted: Wed May 20, 2009 8:53 am
by William M
Mazhar, what happens if the product is taken out of the catalog? Can the link be replaced by a default note, or can an alternate link be dropped in it's place maybe to an alternate category?

ZLA, if you get this going - perhaps with the product's icon? - let us know how please. This is a great 'mini catalog' idea.

Re: Add link to different product in current product description

Posted: Wed May 20, 2009 9:24 am
by ZLA
At this time, I expect I'll just have my customer add the href manually in the product description after they've looked up the other product's url.

Mazhar, from your response, I gather that NVelocity variables embedded in the product description field will be rendered correctly to the client. What is the syntax to retrieve a given product from a productid? For example, something like the following?

$Product.Get(123).ProductUrl

Thanks.

Re: Add link to different product in current product description

Posted: Wed May 20, 2009 9:41 am
by mazhar
No loader classes are not available in NVelocity context, you can just process pre populated objects. One way to access other product available via NVelocity could be to make use of #store.Products.IndexOf(prouctId here) and then #store.Products.getAt(produtIndex) to get actual product.