Guest Posted February 26, 2008 Posted February 26, 2008 Hello! I have some banners in my left and right columns that link to product pages on my site. The problem is that when you click on the banner, the session id is lost. I have tried putting the banners within an info box aswell although this isn't essential. I just can't figure out the code I need to use to keep the session id. Any ideas? Cheers, Mark.
10_little_orcs Posted February 26, 2008 Posted February 26, 2008 Hello! I have some banners in my left and right columns that link to product pages on my site. The problem is that when you click on the banner, the session id is lost. I have tried putting the banners within an info box aswell although this isn't essential. I just can't figure out the code I need to use to keep the session id. Any ideas? Cheers, Mark. Hi, could you post the piece of code that generates the links to the products? Kind regards, 10_little_orcs
Guest Posted February 26, 2008 Posted February 26, 2008 Hi, could you post the piece of code that generates the links to the products? Kind regards, 10_little_orcs Hello 10_little_orcs, Thanks for the reply. Here is the code I currently have in my column_right.php. I have kind of got it working. The problem is the image is now appearing at the top of the column when I really need it to be at the bottom!! <?php /* $Id: column_right.php,v 1.17 2003/06/09 22:06:41 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require(DIR_WS_BOXES . 'shopping_cart.php'); if (isset($HTTP_GET_VARS['products_id'])) // include(DIR_WS_BOXES . 'manufacturer_info.php'); if (tep_session_is_registered('customer_id')) // include(DIR_WS_BOXES . 'order_history.php'); if (isset($HTTP_GET_VARS['products_id'])) { if (tep_session_is_registered('customer_id')) { $check_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "' and global_product_notifications = '1'"); $check = tep_db_fetch_array($check_query); if ($check['count'] > 0) { include(DIR_WS_BOXES . 'best_sellers.php'); } else { // include(DIR_WS_BOXES . 'product_notifications.php'); } } else { // include(DIR_WS_BOXES . 'product_notifications.php'); } } else { // include(DIR_WS_BOXES . 'best_sellers.php'); } require(DIR_WS_BOXES . 'newsletter.php'); if (isset($HTTP_GET_VARS['products_id'])) { if (basename($PHP_SELF) != FILENAME_TELL_A_FRIEND) include(DIR_WS_BOXES . 'tell_a_friend.php'); } else { include(DIR_WS_BOXES . 'specials.php'); } require(DIR_WS_BOXES . 'reviews.php'); include(DIR_WS_BOXES . 'my_flash_box.php'); // include(DIR_WS_BOXES . 'big_cheese_box.php'); if (substr(basename($PHP_SELF), 0, 8) != 'checkout') { // include(DIR_WS_BOXES . 'languages.php'); // include(DIR_WS_BOXES . 'currencies.php'); echo '<p><a href="' . tep_href_link('product_info.php', 'cPath=1&products_id=816') . '"><img src="images/BigCheese.gif" alt="Big Cheese" name="" width="150" height="250" border="0" id="graphic_name"></a></p>'; } ?> Thanks again for your help! Cheers, Mark.
10_little_orcs Posted February 27, 2008 Posted February 27, 2008 Hi, OK, the problem is that the boxes are part of the osCommerce table layout. Since you are using a paragraph tag, it will not know where to put it inside the surrounding table, and thus displays it at a default position. Try and replace echo '<p><a href="' . tep_href_link('product_info.php', 'cPath=1&products_id=816') . '"><img src="images/BigCheese.gif" alt="Big Cheese" name="" width="150" height="250" border="0" id="graphic_name"></a></p>'; with echo '<tr><td><p><a href="' . tep_href_link('product_info.php', 'cPath=1&products_id=816') . '"><img src="images/BigCheese.gif" alt="Big Cheese" name="" width="150" height="250" border="0" id="graphic_name"></a></p></td></tr>'; that should do the trick.:) Kind regards, 10_little_orcs
Guest Posted February 27, 2008 Posted February 27, 2008 Hello 10_little_orcs, Got that working now thanks very much. Sorry to be a pain but I've got another image and I need to do the same but instead of linking to a product page I need to link to a manufacturer's product list. Again I still need to keep the session id. Can you help? Cheers, Mark.
10_little_orcs Posted February 27, 2008 Posted February 27, 2008 Will try my best.:) Could you post the code that generates the link at the moment? Kind regards, 10_little_orcs Hello 10_little_orcs, Got that working now thanks very much. Sorry to be a pain but I've got another image and I need to do the same but instead of linking to a product page I need to link to a manufacturer's product list. Again I still need to keep the session id. Can you help? Cheers, Mark.
Guest Posted February 27, 2008 Posted February 27, 2008 Hello 10_little_orcas, Thanks again. Well I've just got the code that links from an image to a product page at the moment which is... <tr> <td> <?php echo '<p><a href="' . tep_href_link('product_info.php', 'cPath=1&products_id=816') . '"><img src="images/BigCheese.gif" alt="Big Cheese" name="" width="150" height="250" border="0" id="graphic_name"></a></p>'; ?> </tr> </td> Like I said I need pretty much the same thing but to link to the following manufacturers page http://www.punkrockcds.com/i-scream-m-134.html Cheers, Mark.
10_little_orcs Posted February 27, 2008 Posted February 27, 2008 Hello 10_little_orcas, Thanks again. Well I've just got the code that links from an image to a product page at the moment which is... <tr> <td> <?php echo '<p><a href="' . tep_href_link('product_info.php', 'cPath=1&products_id=816') . '"><img src="images/BigCheese.gif" alt="Big Cheese" name="" width="150" height="250" border="0" id="graphic_name"></a></p>'; ?> </tr> </td> Like I said I need pretty much the same thing but to link to the following manufacturers page http://www.punkrockcds.com/i-scream-m-134.html Cheers, Mark. Ah, now I understand! I thought you already had the link to the manufactureres' page and it didn't work. OK, try <tr> <td> <?php echo '<p><a href="' . tep_href_link('index.php', 'manufacturers_id=134') . '">whatever you want to display within the link goes here</a></p>'; ?> </tr> </td> Hope that helps - let me know if it works.:) Kind regards, 10_little_orcs
Guest Posted February 28, 2008 Posted February 28, 2008 Hello 10_little_orcs, Sorry for late reply. My internet connection has been down. Anyway back up now and it worked great!! Thanks so much! Really appreciate all your help. I just have one more piece of code in my index.php where I want to link an image to a product again. I thought I could work it out from the previous ones but I keep getting an error. Here it is... <tr> <td> '<br /><br /><img src="/images/NewReleases.jpg" alt="New Releases" width="650" height="42" hspace="0" vspace="0" border="0" align="center" /></a><br /><br /><a href="http://www.punkrockcds.com/time-again-darker-days-p-2106.html?osCsid=cb5659bd27c3cf8ecf856268a72ba95a"><img'>http://www.punkrockcds.com/time-again-darker-days-p-2106.html?osCsid=cb5659bd27c3cf8ecf856268a72ba95a"><img src="/images/TimeAgain-DarkerDays.jpg" alt="Time Again - Darker Days" width="200" height="186" hspace="10" vspace="10" border="0" align="right" /></a><span class="bypass"></span><http://www.punkrockcds.com/time-again-darker-days-p-2106.html?osCsid=cb5659bd27c3cf8ecf856268a72ba95a" title="Time Again - Darker Days"></a><span class="bypass"><h4><a href="http://www.punkrockcds.com/time-again-darker-days-p-2106.html?osCsid=cb5659bd27c3cf8ecf856268a72ba95a"><font face="verdana" size="4" color="000000">Time Again - Darker Days - </font></a><font face="verdana" size="4" color="FF0000">£7.99</font></h4></strong><font face="arial" size="2" color="000000">Since 2004, Time Again have taken their distinctive brand of adrenaline-fueled street punk from the club scene in their LA hometown to sold-out venues all over the US and Canada, as well as to festival stages in Europe. "Darker Days" written backstage, in cheap hotel rooms, and in their tour van, is filled with emotional suspense and angst, driven by singer Daniel Dart's words of despair and regret, hope and inspiration. They've supported such acts as Social Distortion, Rancid, Tiger Army, The Casualties, Duane Peters, and the Circle Jerks. "This is what punk is. This is a band that's gonna be around for a long time" - Lars Frederiksen (Rancid).</font> </span> </tr> </td> Thanks again, Mark.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.