Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How do I add a new link to information.php?


xPATRIOTSx

Recommended Posts

I want to add a link to my information.php that will go to my forums, and also want it to open a new window.

 

I'm assuming it goes in the following part of the code, just not sure what the line code would be:

$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_FAQ) . '">' . BOX_INFORMATION_FAQ . '</a><br>' .  //FAQ SYSTEM
                                        '<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>');

Go New England Patriots!!!!

Link to comment
Share on other sites

OK, I know I have the coding wrong, I'm such a n00b sorry.

 

My catalog and forums are in my /www/ folder, and here's what I got. Oh, and I added define('BOX_forums', 'Forums(NEW!)'); to my english.php

 $info_box_contents[] = array('text' => '<a href="/forums" target="_blank">' . BOX_Forums . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_FAQ) . '">' . BOX_INFORMATION_FAQ . '</a><br>' .  //FAQ SYSTEM
                                        '<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>');

 

Please don't laugh at me :lol:

Go New England Patriots!!!!

Link to comment
Share on other sites

This is for a link to a forum, in a seperate window, so why would it need the SID?

Vger

What happens if a customer is signed in with an order in his cart and decides to visit the forum? Can he get back to his cart by clicking on the back button?

 

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

What happens if a customer is signed in with an order in his cart and decides to visit the forum?  Can he get back to his cart by clicking on the back button?

 

Jack

It shouldn't matter because the forum is opening up in a separate window correct? I'm probably wrong :lol:

 

Anyway, still can't get the link to show up.

Go New England Patriots!!!!

Link to comment
Share on other sites

No, you're not wrong, you're dead right. The user is not leaving the old window at all.

 

Vger

It shouldn't matter because the forum is opening up in a separate window correct?  I'm probably wrong  :lol:

 

Anyway, still can't get the link to show up.

Link to comment
Share on other sites

OK, I know I have the coding wrong, I'm such a n00b sorry.

 

My catalog and forums are in my /www/ folder, and here's what I got.  Oh, and I added define('BOX_forums', 'Forums(NEW!)'); to my english.php

 $info_box_contents[] = array('text' => '<a href="/forums" target="_blank">' . BOX_Forums . '</a><br>' .
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? '<a href="' . tep_href_link(FILENAME_FAQ) . '">' . BOX_INFORMATION_FAQ . '</a><br>' . ?//FAQ SYSTEM
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? '<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>');

 

Please don't laugh at me  :lol:

Try this instead: (I'm asuming the name of the page oyu are loading is forums.php)
$info_box_contents[] = array('text' => 
                                       '<a href="' . tep_href_link('forums.php') . '">' . BOX_Forums . '</a><br>' .

BTW, since you are defining the text, BOX_Forums, you should also define the filename in filenames.php as

define('FILENAME_BOX_FORUM', 'forums.php');

It is not required but will make troubleshooting your site easier in the future.

 

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

It shouldn't matter because the forum is opening up in a separate window correct?  I'm probably wrong  :lol:

Nope, you are correct. I read the part about the other window but it didn't register with me for some reason. However, if, for some reason, you ever decide to change it so that the forum doesn't open in a new window, you will break your shop. Following the standard guidelines will prevent this. It doesn't hurt you to do it, but it may if you don't.

 

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 this instead: (I'm asuming the name of the page oyu are loading is forums.php)
$info_box_contents[] = array('text' => 
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'<a href="' . tep_href_link('forums.php') . '">' . BOX_Forums . '</a><br>' .

BTW, since you are defining the text, BOX_Forums, you should also define the filename in filenames.php as

define('FILENAME_BOX_FORUM', 'forums.php');

It is not required but will make troubleshooting your site easier in the future.

 

Jack

My fault, I should have explained it better.

 

The forum is totally separate. It's a phpbb.com forum and not defined by a single file.

 

What I need is a link in the information box that will read Forums(NEW!), with a link to the forum itself, in a new window. Just like if I wanted to add a link to go to these forums here, same thing different address :D

 

Sorry, I get excited and always forget to add important info like that :lol:

Go New England Patriots!!!!

Link to comment
Share on other sites

NP - I do it all of the time. :) Does the code Vger supplied not work? You may want to use the absoulte address in the link (http://www...). What problem are you having? Is the link not showing up or just not working?

 

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

NP - I do it all of the time. :)? Does the code Vger supplied not work?? You may want to use the absoulte address in the link (http://www...).? What problem are you having?? Is the link not showing up or just not working?

 

Jack

I'm getting so pissed, this should be so simple and I know I'm making a stupid mistake somewhere :lol:

 

The link isn't showing up at all using Vger's code, and I just tried the absolute path to no avail :'(

 $info_box_contents[] = array('text' => '<a href="http://www.livewirehardware.com/forums" target="_blank">Forums</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_FAQ) . '">' . BOX_INFORMATION_FAQ . '</a><br>' .  //FAQ SYSTEM
                                        '<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>');

Go New England Patriots!!!!

Link to comment
Share on other sites

'<a href="' . tep_href_link(FILENAME_FORUM) . '" target="_blank"></>' . BOX_INFORMATION_FORUM . '</a><br>' .

 

then in catalog/includes/filenames.php

 

 ?define('FILENAME_FORUM', 'forum/index.php');

 

then in catalog/includeslanguages/english.php

 

define('BOX_INFORMATION_FORUM', 'Forum');

 

I am also using phpBB and for the link code posted I have the forum directory inside the catalog directory

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

'<a href="' . tep_href_link(FILENAME_FORUM) . '" target="_blank"></>' . BOX_INFORMATION_FORUM . '</a><br>' .

 

then in catalog/includes/filenames.php

 

 ?define('FILENAME_FORUM', 'forum/index.php');

 

then in catalog/includeslanguages/english.php

 

define('BOX_INFORMATION_FORUM', 'Forum');

 

I am also using phpBB and for the link code posted I have the forum directory inside the catalog directory

I'm going to cry. I know you guys are giving me the right info but nothing is working.

 

This is what I have per 241's code(and I changed all the FORUM to FORUMS to make it easier to keep track):

information.php

'<a href="' . tep_href_link(FILENAME_FORUMS) . '" target="_blank"></>' . BOX_FORUMS . '</a><br>' .

 

filenames.php

define('FILENAME_FORUMS', 'forums/index.php');

 

english.php

define('BOX_FORUMS', 'Forums');

 

For some reason the link just won't show up in the box.

Go New England Patriots!!!!

Link to comment
Share on other sites

post the code for the information.php as it is now

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

post the code for the information.php as it is now

I appreciate everyone's patience

<?php
/*
 $Id: information.php,v 1.6 2003/02/10 22:31:00 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
?>
<!-- information //-->
         <tr>
           <td>
<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => BOX_HEADING_INFORMATION);

 new infoBoxHeading($info_box_contents, false, false);

 $info_box_contents = array();
 $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_FORUMS) . '" target="_blank"></>' . BOX_FORUMS . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_FAQ) . '">' . BOX_INFORMATION_FAQ . '</a><br>' .  //FAQ SYSTEM
                                        '<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>');

 new infoBox($info_box_contents);
?>
           </td>
         </tr>
<!-- information_eof //-->

Go New England Patriots!!!!

Link to comment
Share on other sites

I am to blame you have this extra code in the code line

</>

 

here you go

 

<?php
/*
$Id: information.php,v 1.6 2003/02/10 22:31:00 hpdl Exp $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/
?>
<!-- information //-->
? ? ? ? <tr>
? ? ? ? ? <td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_INFORMATION);

new infoBoxHeading($info_box_contents, false, false);

$info_box_contents = array();
$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_FORUMS) . '" target="_blank">' . BOX_FORUMS . '</a><br>' .
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'<a href="' . tep_href_link(FILENAME_FAQ) . '">' . BOX_INFORMATION_FAQ . '</a><br>' . ?//FAQ SYSTEM
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'<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>');

new infoBox($info_box_contents);
?>
? ? ? ? ? </td>
? ? ? ? </tr>
<!-- information_eof //-->

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Hold everything! Just as an experiment I deleted the FAQ line but it still was showing up? I recently moved all the catalog files from /www/catalog to /www/ as I'm using the catalog itself as my home page. I changed everything in the configure.php files to match the new root, but is there another file I needed to do that in?

Go New England Patriots!!!!

Link to comment
Share on other sites

Hold everything!  Just as an experiment I deleted the FAQ line but it still was showing up?  I recently moved all the catalog files from /www/catalog to /www/ as I'm using the catalog itself as my home page.  I changed everything in the configure.php files to match the new root, but is there another file I needed to do that in?

OMG, I refuse to tell you guys what I did :lol: When I said it was probably some stupid mistake I was making, well I was right :blush:

 

Thank you all for putting up with me. 241 your code is working great, and I'm sure all the others would have too :blush:

Go New England Patriots!!!!

Link to comment
Share on other sites

hey what counts is that you have gotten it all sorted out and working :D and gained a bit more something to boot :thumbsup:

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...