Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

linking to a product?


warrenerjm

Recommended Posts

Hi

 

Can someone please tell me how I can link to a product. I would like to write about a product in one of my pages & link it to the sub category (or category) if there are more than one product, or to the product info if there is only one. I know how to link from one static page to another, but am stumped with products.

 

I hope someone finds this easy & can help little old me. :D

 

Thanks

Julie

Link to comment
Share on other sites

Try something like

 <?php echo '<td><a href="' . tep_href_link('product_info.php', 'products_id=122', 'NONSSL') . '">' .  'Some Text Goes Here' . '</a>'; ?></td>

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Try something like
 <?php echo '<td><a href="' . tep_href_link('product_info.php', 'products_id=122', 'NONSSL') . '">' .  'Some Text Goes Here' . '</a>'; ?></td>

 

Jack

Thanks Jack. This looks like a single product link, which is what I am looking for, but I also need to link to a category too. Do you know how I would do that. As you are now helping me on three fronts, I have a nice pile to work through later. Another late night!

 

Julie :thumbsup:

Link to comment
Share on other sites

Well, we don't want you slacking off. :) Try this for the category link:

<?php echo '<td><a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=1', 'NONSSL') . '">' .  'Some Text Goes Here' . '</a>'; ?></td>

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Well, we don't want you slacking off. :) Try this for the category link:
<?php echo '<td><a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=1', 'NONSSL') . '">' .  'Some Text Goes Here' . '</a>'; ?></td>

 

Jack

Cheers! No rest for the wicked. :P

 

Julie :thumbsup:

Link to comment
Share on other sites

Well, we don't want you slacking off. :) Try this for the category link:
<?php echo '<td><a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=1', 'NONSSL') . '">' .  'Some Text Goes Here' . '</a>'; ?></td>

 

Jack

Hi Jack

 

I tried to put this within my main text in the index.php,

define('TEXT_MAIN', '<table border="0"width="100%"cellspacing="5"cellpadding="2">

but it didn't like it. I had a play to see if I could learn something, but just kept coming up with various errors. :-"

 

Any ideas?

 

Thanks

Julie

 

ps; I did change the cPath

Link to comment
Share on other sites

Your code didn't display properly but I think I know what the problem is. The code I gave you was for the files in the root. To use it in a file in the english/ directory, you need to use

<td><a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=1', 'NONSSL') . '"> Some Text</a></td>

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...