Add link to different product in current product description

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
ZLA
Commodore (COMO)
Commodore (COMO)
Posts: 496
Joined: Fri Mar 13, 2009 2:55 pm

Add link to different product in current product description

Post by ZLA » Wed May 20, 2009 8:10 am

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.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Add link to different product in current product description

Post by mazhar » Wed May 20, 2009 8:26 am

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.

William M
Commander (CMDR)
Commander (CMDR)
Posts: 150
Joined: Sat Feb 14, 2009 9:40 am
Contact:

Re: Add link to different product in current product description

Post by William M » Wed May 20, 2009 8:53 am

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.

ZLA
Commodore (COMO)
Commodore (COMO)
Posts: 496
Joined: Fri Mar 13, 2009 2:55 pm

Re: Add link to different product in current product description

Post by ZLA » Wed May 20, 2009 9:24 am

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.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Add link to different product in current product description

Post by mazhar » Wed May 20, 2009 9:41 am

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.

Post Reply