Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Adding link to Column


Recommended Posts

I want to add a link to my forums at the top of the "Information" box in the left column, but I'm terrible at using PHP and don't know how to do this.


My website is: www.showrides.tk


My forum is: http://s10.invisionfree.com/Show_Rides/index.php?act=idx


I tried using HTML to do the link, but it didn't work. It might be because I had a typo, but I'm pretty sure my code was correct, it just won't work on a PHP site.


Thanks in advance for the help :D

Link to comment
Share on other sites

Ok you need to open catalog/includes/boxes/information.php


Find this code:

'<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>');


You need to make another line like them, and put it at the top. You want to refer to the file you want to link to in the new line: Just copy the shipping line, paste it in, and change both SHIPPING s to YOUR_NEW_FILENAME


Next you need to a a define in catalog/includes/languages/english.php. Find this:

// information box text in includes/boxes/information.php
define('BOX_HEADING_INFORMATION', 'Information');
define('BOX_INFORMATION_PRIVACY', 'Privacy Notice');
define('BOX_INFORMATION_CONDITIONS', 'Conditions of Use');
define('BOX_INFORMATION_SHIPPING', 'Shipping & Returns');
define('BOX_INFORMATION_CONTACT', 'Contact Us');


copy one of the lines, paste it in (order isn't important, but if you care put it just after the 'BOX_HEADING_INFORMATION'. It should be:

define('BOX_INFORMATION_YOUR_NEW_FILENAME', 'Your New Filename');


Assuming the file to be linked to is another info page, it should be in the root directory (catalog in default). If you want it to be in line with the other pages, copy one of their root directory files, and change the name and instances of the filename within to your new file name. Next go to the catalog/includes/languages/english/one of the info page files.php. Again change the filename, and all the references to the filename within, just like the other one. Edit the text definitions to add the information you want.


That's it, generally speaking, I'll see if you need anything else when you post the answer to what file you are linking to.



Link to comment
Share on other sites

Ha, silly me, you said that and I failed to fully read your post, sorry! In that case you can get away with just the first two files. Add this to the top of the list in boxes.php:

'<a href="' . tep_href_link(http://s10.invisionfree.com/Show_Rides/index.php) . '">' . BOX_INFORMATION_FORUM . '</a><br>' .


In the english.php file add:

define('BOX_INFORMATION_FORUM', 'Forum');


That should do it!



Link to comment
Share on other sites

Try switching to this for now:


'<a href="http://s10.invisionfree.com/Show_Rides/index.php">' . BOX_INFORMATION_FORUM . '</a><br>' .


I'm messing up the tep a href syntax, and need to work that out. This will screw with the session when the customer leaves the site, but I think it would anyways, since the forum is not within your osc store.



Link to comment
Share on other sites

Nicely Done :D


Thanks for the help, it works great.


Is there anyway I can make it open up in a new window though, adding something such as link[target=window] or something like that?

Link to comment
Share on other sites

I think Jeremy at oddly enough assumed your link resided in catalog/ if not


----Replace "YOUR_LINK" with the desired name----


1- First identify the file name in catalog>includes>filenames.php


add this code

define('CONTENT_YOUR_LINK', 'your_link');


2- in catalog>includes>boxes>information.php find

  $boxContent = '<a href="' . tep_href_link(FILENAME_YOUR_LINK) . '"> ' . BOX_INFORMATION_YOUR_LINK . '</a><br>' .
               '<a href="' . tep_href_link(FILENAME_YOUR_LINK2) . '"> ' . BOX_INFORMATION_YOUR_LINK2 . '</a><br>' .
               '<a href="' . tep_href_link(FILENAME_YOUR_LINK3) . '"> ' . BOX_INFORMATION_YOUR_LINK3 . '</a>';


and insert

  '<a href="' . tep_href_link(YOUR_LINK) . '"> ' . BOX_INFORMATION_YOUR_LINK . '</a><br>' .


at the position you want it to show


3- Now copy this code and name it "your_link.php"

 $Id: privacy.php,v 1.4 2002/11/19 01:48:08 dgw_ Exp $

 osCommerce, Open Source E-Commerce Solutions

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License

define('NAVBAR_TITLE', 'Your Link');
define('HEADING_TITLE', 'Your Link');

define('TEXT_INFORMATION', '<a href="http://s10.invisionfree.com/Show_Rides/index.php?act=idx"><u>your link</u></a>');

4- then FTP to catalog>includes>langues>english


You can also use a redirect if you want to open a new page.

My apologies if I misunderstood the situation, or stepped on any toes .


:thumbsup: wazu

Link to comment
Share on other sites

No problem wazu, actually I was searching for how to do that myself, and it would have been days before I figured out how to do that as cleverly! I only heard about tep_href_link and saw its importance for preserving session info yesterday. My sitemap link page is all html hrefs, and I have some in my nav bar that I'll need to fix too. Got a good project for tomorrow! I need to get chemo's ultimate seo urls going, then fix my links up!





By the way, vesper you ought to take a few minutes and fix up the link to use the tep_href_link, instaed of the straight html link I gave you.

Link to comment
Share on other sites

It has to do with passing along, and preserving information specific to each vistor. If they start adding things to their cart, if they switch languages, etc., the info might get dropped using regular links, but the tep links will preserve the session info, as the customer navigates through the site. That's the impression I got, if I'm incorrect, can someone who knows for sure set the record straight?



Link to comment
Share on other sites


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

  • Create New...