Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Image linking from home page to products


roobear

Recommended Posts

I would like to add a link from an image on my home page to the product the image is promoting. I am new to 2.3 and it is giving me a hid ache.

My site is pennylanegifts.co.uk so you can see what I mean.

Cheers in advance

Link to comment
Share on other sites

this works:

 

<?php echo '<a href="' . tep_href_link('product_info.php?products_id=<insert_product_id_here>') . '">' . tep_image(DIR_WS_IMAGES . '<insert_product_image_name_here_including_extension>') . '</a>'; ?>

 

Mark

Link to comment
Share on other sites

Hi As mentioned earlier I copied this file and changed the variables but nothing on site happens, it just crashes, am I typing the right variables in.

I am placing it in languages/english/index page So that I have image links on my home page

Cheers everyone

Des

 

<?php echo '<a href="' . tep_href_link('product_info.php?products_id=<46&products_id=56>') . '">' . tep_image(DIR_WS_IMAGES . '<baby-wear.GIF>') . '</a>'; ?>

 

pennylanegifts.co.uk

Link to comment
Share on other sites

<?php echo '<a href="' . tep_href_link('product_info.php?products_id=46') . '">' . tep_image(DIR_WS_IMAGES . '<baby-wear.gif>') . '</a>'; ?>

<?php echo '<a href="' . tep_href_link('product_info.php?products_id=56') . '">' . tep_image(DIR_WS_IMAGES . '<baby-wear.gif>') . '</a>'; ?>

 

Try that - just one value for products_id and the <> removed

Link to comment
Share on other sites

No mate, it just comes up with server error.

This is the code I have just to place the images and I just removed it and copied your code

 

 

define('TEXT_MAIN', "

<center/><image src=images/baby-wear.gif>

<image src=images/web-image-link.gif>

<image src=images/web-image-link.gif>

<image src=images/hi-viz.gif>

<image src=images/pp.gif>

<image src=images/pp2.gif>

<image src=images/comodo_secure_100x85_transp.png><center/>

");

 

Thanks for the help

Link to comment
Share on other sites

Right !

I had placed the html above in lanuages/english/.index so I removed the html and replaced it with..

<?php echo '<a href="' . tep_href_link('product_info.php?products_id=<46&products_id=56>') . '">' . tep_image(DIR_WS_IMAGES . '<baby-wear.GIF>') . '</a>'; ?>

The Site does not load, then I thought if the slider is on a diff page and still loads on the home page maybe I am placing code in the wrong place ?

So I have now placed the code above the slider script and below the last DIV tag in catalogue/index and now I get the link which is cool but no image just a image holder. Tried adding and removing the last brackets and site does not load.

Getting there slowly.

Any ideas folks

pennylanegifts.co.uk

Link to comment
Share on other sites

Sorted thanks everyone. I put the image in wrong place !

Code is added in catalogue/index

 

And it is the one from above

 

<?php echo '<a href="' . tep_href_link('product_info.php?products_id=place digits here') . '">' . tep_image(DIR_WS_IMAGES . 'name of image') . '</a>'; ?>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...