Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Want to Add Link to header.php


Marvin Miller

Recommended Posts

Hi;

 

I would like to put a link in the My Account | Cart Contents | Checkout section on the top right of my site. I understand this is done by editing header.php and I also know the section of code but I am not able to do it - because I know little programming!

 

Can someone help by giving me an actual example? Here's how I would like it to look:

 

Discussion Forum | My Account | Cart Contents | Checkout |

(so, I want to add the Discussion Forum link)

 

Here's the chunk of code in header.php;

 

<table border="0" width="100%" cellspacing="0" cellpadding="1">
 <tr class="headerNavigation">
   <td class="headerNavigation">  <?php echo $breadcrumb->trail(' » '); ?></td>
   <td align="right" class="headerNavigation"><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a>  |  <?php } ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a>   </td>
 </tr>
</table>

 

Can someone help? It would mean a lot to me and should be easy for a person with coding experience :thumbsup:

Best & Thanks;
Marvin
----------------------
osCommerce 2.3.3.4 

Link to comment
Share on other sites

You can duplicate one of your existing links and then just change the info. What you are going to need to do is set your defines.

 

In your filenames.php file you will need to define the file to your forum, it will look something like

 

define('FILENAME_Forum', 'forum.php'); You will need to have the filename and path here.

 

Then you will need to define the text for your link. This is done in your english.php file and should look like

 

define('HEADER_TITLE_FORUM', 'Forum');

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Link to comment
Share on other sites

Hi Richard;

 

Thank you very much for your reply - it helped a lot and I have somewhat of an understanding as to what we are actually doing by defining the variable and then calling it in header.php

 

There is an issue though and it relates to the filenames.php entry for my forum;

define('FILENAME_Forum', 'forum.php');

 

The problem is that osCommerce is trying to access forum.php from the defined site root - in this case clicking on the link takes me to;

 

http://www.frostysac.com/~frostysa/catalog/forum.php?osCsid=

 

The actual forum is located at http://www.frostysac.com/forum

 

so it's not in the site's root definition. Any ideas on what I should do in this circumstance?

 

Best; :thumbsup:

Marvin

Best & Thanks;
Marvin
----------------------
osCommerce 2.3.3.4 

Link to comment
Share on other sites

The correct tep way of doing it would be add the filename and text in the appropriate files the more practical way is to simply used this code:

<table border="0" width="100%" cellspacing="0" cellpadding="1">
 <tr class="headerNavigation">
   <td class="headerNavigation">  <?php echo $breadcrumb->trail(' » '); ?></td>
   <td align="right" class="headerNavigation"><?php if (tep_session_is_registered('customer_id')) { ?>
     <a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a>  | 
     <?php } ?>
     <a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a> | <a href="http://www.frostysac.com/forum/" target="_blank">Discussion Forum</a>   </td>
 </tr>
</table>

Notice it's just a normal HTML tagged link? Not too hard...

Link to comment
Share on other sites

Thanks Chemo - that does work but the link is not the same color as the other ones - so it doesn't seem to follow the same format as the other ones.

 

Why would that be? I would think it would use the same colors as the other links - any ideas on how to fix that? :thumbsup:

 

Sorry for the silly questions - I really have a hard time with programming but I've got some pretty cool contributions added into my site and the core functionality that I was after is almost all there. :D

Best & Thanks;
Marvin
----------------------
osCommerce 2.3.3.4 

Link to comment
Share on other sites

Thanks Chemo - that does work but the link is not the same color as the other ones - so it doesn't seem to follow the same format as the other ones.

 

Why would that be? I would think it would use the same colors as the other links - any ideas on how to fix that?  :thumbsup:

 

Sorry for the silly questions - I really have a hard time with programming but I've got some pretty cool contributions added into my site and the core functionality that I was after is almost all there.  :D

Try this:

<table border="0" width="100%" cellspacing="0" cellpadding="1">
<tr class="headerNavigation">
  <td class="headerNavigation">  <?php echo $breadcrumb->trail(' » '); ?></td>
  <td align="right" class="headerNavigation"><?php if (tep_session_is_registered('customer_id')) { ?>
    <a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a>  | 
    <?php } ?>
    <a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a> | <a href="http://www.frostysac.com/forum/" target="_blank" class="headerNavigation">Discussion Forum</a>   </td>
</tr>
</table>

Forgot to use the CSS class...

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...