roobear Posted April 6, 2013 Posted April 6, 2013 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
PupStar Posted April 6, 2013 Posted April 6, 2013 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
roobear Posted April 6, 2013 Author Posted April 6, 2013 Thanks Mark will have a go at that. Watch this space
roobear Posted April 6, 2013 Author Posted April 6, 2013 I don't suppose you know where I get the product ID from do you Mark ? Just goggled and found nowt. Using OSC 2.3 Cheers Des
♥14steve14 Posted April 6, 2013 Posted April 6, 2013 Try looking in your database. The product ids are there. REMEMBER BACKUP, BACKUP AND BACKUP
♥14steve14 Posted April 6, 2013 Posted April 6, 2013 Forgot to say that you may also find in if you open the file in a browser and look at the product url. REMEMBER BACKUP, BACKUP AND BACKUP
roobear Posted April 7, 2013 Author Posted April 7, 2013 Thanks eveyone I will have a go this week, just loaded generic boxes so I am learning slowly. Des
roobear Posted April 8, 2013 Author Posted April 8, 2013 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
Bob Terveuren Posted April 8, 2013 Posted April 8, 2013 <?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
roobear Posted April 9, 2013 Author Posted April 9, 2013 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
roobear Posted April 15, 2013 Author Posted April 15, 2013 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
roobear Posted April 17, 2013 Author Posted April 17, 2013 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>'; ?>
Recommended Posts
Archived
This topic is now archived and is closed to further replies.