Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Move info-Boxes to Header or footer


jaysin

Recommended Posts

Posted

Hi This is how I did and is working for me hope this work for you too! To move information boxes from column_left.php to the header or footer or on any page where you want this to show but want to not show the heading of the info_box find lines

require(DIR_WS_BOXES . 'information.php');

comment out or replace the line catalog/includes/column_left.php with this

// require(DIR_WS_BOXES . 'information.php');

open catalog/includes/boxes/information.php and replace with this

 <?php

/*

  $Id: information.php,v 1.1 2003/02/22 17:58:22 wilt Exp $

  orig : 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

 $informationString = "";

 $sql=mysql_query('SELECT infopages_id, info_title FROM ' . TABLE_INFOPAGES .' WHERE visible='1' ORDER BY v_order')

   or die(mysql_error());



 while($row=mysql_fetch_array($sql)): 

   $informationString .= '<a href="' . tep_href_link(FILENAME_INFOPAGES, 'info_id=' . $row['infopages_id'], 'NONSSL') . '">' . $row['info_title'] . '</a>' . '  |  '; 

 endwhile;

 // $info_box_contents = array();

// $info_box_contents[] = array('text' => BOX_HEADING_INFORMATION);



// new infoBoxHeading($info_box_contents, false, false);



 $row = 0;

 $col = 0;

 $info_box_contents = array();

 $info_box_contents[] = array('align' => 'center',

                                        'text' => '<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a>' . '  |  ' .

          '<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a>' . '  |  ' .

                                        '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a>' . '  |  ' .

                                        '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>' . '  |  ' . 

                                        '<a href="' . tep_href_link(FILENAME_GV_REDEEM, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a>');//ICW ORDER TOTAL CREDIT CLASS/GV

 

 $col ++;

       if ($col > 2) {

         $col = 0;

         $row ++;

       }



     new contentBox($info_box_contents);

?>

           </td>

         </tr>

<!-- information_eof //-->

 

open catalog/includes/footer.php

 

find lines

<td align="right" class="footer">  <?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted; ?>  </td>

 </tr>

</table>

<table border="0" width="100%" cellspacing="0" cellpadding="0">

and replace this with

<td align="right" class="footer">  <?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted; ?>  </td>

 </tr>

</table>

<table border="0" width="100%" cellspacing="0" cellpadding="0">



 <tr>

   <td align="center"><?php echo require(DIR_WS_BOXES . 'information.php'); ?></td>

 </tr>

</table>

  • 5 years later...
Posted
Hum? This code is not working anyone see where the glitch is?

I have no clue what that information.php page above is. If all you want is to put the links from your information box in your footer, do this. In catalog/includes/footer.php find

<table border="0" width="100%" cellspacing="0" cellpadding="1">
 <tr class="footer">
<td class="footer">  <?php echo strftime(DATE_FORMAT_LONG); ?>  </td>
<td align="right" class="footer">  <?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted; ?>  </td>
 </tr>
</table>
<br>

Right below it add

<table border="0" width="100%" cellspacing="0" cellpadding="1">
 <tr>
<td align="center"><?php echo '<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a>'; ?>  |  </td>
<td align="center"><?php echo '<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a>'; ?>  |  </td>
<td align="center"><?php echo '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a>'; ?>  |  </td>
<td align="center"><?php echo '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>'; ?></td>
 </tr>
</table>
<br>

Make sure to backup first.

Posted

Wow!

That worked perfect Brian!

Thank you baby.

 

Hey I should be able to do the same thing with the language box, right?

 

I'd like to add it to the header but what file name are they under and do you know how to find the path for category pages so I can create these links for those pages?

 

 

You Awesome!

Donni Rai

Posted
Hey I should be able to do the same thing with the language box, right?

I'd like to add it to the header but what file name are they under

The information.php, languages.php and so on are located in catalog/includes/boxes. I don't like using those in the format they are when placing them in the header or foote. They all use the infobox class which more than likely going to be different from your header and footer.

 

You also need to be careful when moving the languages and the currencies. To put the languages in the header you could something like this. This will put it above the logo aligned to the right. In catalog/includes/header.php find

<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr class="header">
<td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'store_logo.png', STORE_NAME) . '</a>'; ?></td>
<td align="right" valign="bottom"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>  <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>  <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?>  </td>
 </tr>
</table>

Just above that add

<?php
 if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
 if (!isset($lng) || (isset($lng) && !is_object($lng))) {
include(DIR_WS_CLASSES . 'language.php');
$lng = new language;
 }

 $languages_string = '';
 reset($lng->catalog_languages);
 while (list($key, $value) = each($lng->catalog_languages)) {
$languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES .  $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> ';
 }
?>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr class="header">
<td align="right"><?php echo $languages_string; ?></td>
 </tr>
</table>
<?php
 }
?>

Note this part at the top

  if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {

That is stopping the languages from displaying during the checkout. You do not want people changing languages or currencies during checkout. It can cause problems.

 

and do you know how to find the path for category pages so I can create these links for those pages?

Not sure what you're asking here. What are trying to do?

Posted

I should have added as weel. If you want to add the text Languages before the language flags, change this

	<td align="right"><?php echo $languages_string; ?></td>

to

	<td class="smallText" align="right"><?php echo BOX_HEADING_LANGUAGES . ' ' . $languages_string; ?></td>

Posted

Wow!

 

Thank you again BKTrain.

Just now seeing this. I'll try it now.

 

 

Donni Rai

  • 2 years later...
  • 1 year later...
Posted

hi, can you explain how to put currency box in header too??

thanks

 

I want to know this too!

 

I will like to put the currencies box in the header.

Archived

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

×
×
  • Create New...