Zen Cart Logo
Forums / General Questions / Create dynamic link to a spesific product page

Create dynamic link to a spesific product page

Locked

Views: 1,273

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
3 Jan 2009, 9:53 AM
#1
solvenus avatar

solvenus

New Zenner

Join Date:
Dec 2008
Posts:
24
Plugin Contributions:
0

Create dynamic link to a spesific product page

Hi!

I am wondering how to create a dynamic link that points to a spesific product info page?

I don't find anything I can copy from Zen Cart, since all those links is autogenerated and not spesific to just one product. I need a spesific one, like to product 1 or product 2.

I don't find anything about this anywere..

Thank you for any reply!

Svein Daniel Solvenus

3 Jan 2009, 10:23 AM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Create dynamic link to a spesific product page

This depends where you wish to insert the link. There also seems to be some inherent contradiction in your wishing to create a dynamic link to point to a specific product page. However, the code you need to point to rthe product page with Id = nnn is likely to something like:

this if it's needed for an HTML block

<a href="<?php echo zen_href_link(zen_get_info_page(nnn),'products_id='.nnn)) ?>">your-link-text</a>

or this if it's being inserted into a PHP block

echo '<a href="' . zen_href_link(zen_get_info_page(nnn),'products_id='.nnn)) . '">your-link-text</a>';
3 Jan 2009, 11:27 AM
#3
solvenus avatar

solvenus

New Zenner

Join Date:
Dec 2008
Posts:
24
Plugin Contributions:
0

Re: Create dynamic link to a spesific product page

Thank you kuroi!

Do you know how to make these links work with ez pages?

The php code where just written as plain text....

3 Jan 2009, 12:14 PM
#4
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Create dynamic link to a spesific product page

EZ-Pages are designed for static content rather than PHP. There is a way to force PHP into them (tecBrat posted on this about 18-24 months ago) but it's a bit technical and opens up some security concerns, so I wouldn't recommend it.