Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

A simple trick from a new guy, pt. 2


jwsfun

Recommended Posts

Like a lot of people using osCommerce (I use 2.2-CVS), I tend to think that there are way too many boxes floating around. One of them that I felt was better suited being displayed differently, by moving it to the footer bar, was the information box.

The first step to doing this is simply to "comment out" the information box itself (two // in front of the require for the information box in whatever column_XXXXX.php you have it in).

Next, you can simply use the code from the header.php that I've altered (below) and paste it into your footer.php immediately following the "require(DIR_WS_INCLUDES . 'counter.php'); ?>" at the very top of the footer.php, so it looks like this:

 

require(DIR_WS_INCLUDES . 'counter.php');

?>

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

<tr class="headerNavigation">

<td align="center" class="headerNavigation"><?php { ?><a href="<?php echo tep_href_link(FILENAME_FAQ, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_FAQ; ?></a>    <?php } ?><a href="<?php echo tep_href_link(FILENAME_CONDITIONS, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CONDITIONS_OF_USE; ?></a>    <a href="<?php echo tep_href_link(FILENAME_PRIVACY, '', 'NONSSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_PRIVACY_NOTICE; ?></a>    <a href="<?php echo tep_href_link(FILENAME_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_SHIPPING_AND_RETURNS; ?></a>    <a href="<?php echo tep_href_link(FILENAME_CONTACT_US, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CONTACT_US; ?></a>   </td>

</tr>

</table>

 

Two points of interest: Ignore the cellpadding, "4", whereas it is site-relative. You should set the padding to your desired thickness.

You will also notice that there is a link to a "FAQ" page: You can delete this from the code safely, if you do not have a FAQ page of your own. Just delete "<a href="<?php echo tep_href_link(FILENAME_FAQ, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_FAQ; ?></a>    <?php } ?>".

 

Finally, the last step is to define all of this in your shop/includes/languages/english.php, under "// footer text in includes/footer.php":

 

define('HEADER_TITLE_FAQ', 'faq'); (if you have one)

define('HEADER_TITLE_CONDITIONS_OF_USE', 'conditions of use');

define('HEADER_TITLE_PRIVACY_NOTICE', 'privacy notice');

define('HEADER_TITLE_SHIPPING_AND_RETURNS', 'shipping & returns');

define('HEADER_TITLE_CONTACT_US', 'contact us');

 

Two last points: Notice that everything (above, in the english.php) is in lower case; again, that is site-relative and you should change it to match your own. Lastly, notice that there is no define for "requests since", simply because I don't want it and have commented it out.

 

Easy, huh? I'm still learnin'. :)

Link to comment
Share on other sites

My apologies: I neglected to mention that I have also removed the following from the footer.php:

 

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

 

The first <tr class should read <tr class"headerNavigation", exactly as shown in the previous post. Otherwise, you'll end-up with a footer on top of a footer!

Remember to set the align to "center" and delete the above code. Otherwise, this will not work.

Unless, of course, some of you php experts out there can figure out how to leave in the date and the "requests since" while displaying the footer links in the center of the bar...I haven't been able to.

Link to comment
Share on other sites

Hi Jeff,

 

I tweaked your code. This places the default osCommerce footer below your footer,

it leaves your footer centered. It is basically just two tables, one below the other.

 

Hope it helps.

 

Just replace this

 

require(DIR_WS_INCLUDES . 'counter.php');

?>

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

<tr class="headerNavigation">

<td align="center" class="headerNavigation"><?php { ?><a href="<?php echo tep_href_link(FILENAME_FAQ, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_FAQ; ?></a>    <?php } ?><a href="<?php echo tep_href_link(FILENAME_CONDITIONS, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CONDITIONS_OF_USE; ?></a>    <a href="<?php echo tep_href_link(FILENAME_PRIVACY, '', 'NONSSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_PRIVACY_NOTICE; ?></a>    <a href="<?php echo tep_href_link(FILENAME_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_SHIPPING_AND_RETURNS; ?></a>    <a href="<?php echo tep_href_link(FILENAME_CONTACT_US, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CONTACT_US; ?></a>   </td>

</tr>

</table>

 

 

With this

 

require(DIR_WS_INCLUDES . 'counter.php');

?>

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

<tr class="headerNavigation";"footer">

<td align="center" class="headerNavigation"><?php { ?><a href="<?php echo tep_href_link(FILENAME_FAQ, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_FAQ; ?></a>    <?php } ?><a href="<?php echo tep_href_link(FILENAME_CONDITIONS, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CONDITIONS_OF_USE; ?></a>    <a href="<?php echo tep_href_link(FILENAME_PRIVACY, '', 'NONSSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_PRIVACY_NOTICE; ?></a>    <a href="<?php echo tep_href_link(FILENAME_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_SHIPPING_AND_RETURNS; ?></a>    <a href="<?php echo tep_href_link(FILENAME_CONTACT_US, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CONTACT_US; ?></a>   </td>

</tr>

</table>

 

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

<td align="left" 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>

 

 

EarlJ

Link to comment
Share on other sites

Earl,

 

I tried the code you supplied, but it's a "no go": I ended up doing this (see pic below) to get the date and "requests since" back into the footer (but have since removed it because it's too congested):

 

footer.gif

 

Thanks for your advice :).

Link to comment
Share on other sites

  • 1 month later...

I went about it a little differently, I guess.

I took out the "Requests Since", and added the links directly to the bar, and added separaters.

 

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

<tr class="footer">

<td class="footer" align="left">  <?php echo strftime(DATE_FORMAT_LONG); ?>  </td>

<td class="footer" align="right" '<a href="http://site.com/index.htm">site.com</a> |

<a href="http://site.com/shop/shipping.php">Shipping</a> |

<a href="http://site.com/shop/privacy.php">Privacy Policy</a> |

<a href="http://site.com/shop/conditions.php">Conditions of Use</a> |

<a href="http://site.com/shop/contact_us.php">Contact Us</a>

 

</tr>

</table>

 

I had tried them relative, but they didnt wanna work...

 

at any rate, they do now :)

One of these days, I will actually understand what I just changed...

 

But reading the Manual DEFINATELY helps...

Link to comment
Share on other sites

jwsfun, what code do you copy and how do you go about putting the search box in the header like on your site? Im working on a flash header for a site and i don't know what code to put on the search box, im using SwishMax to do it though, any ideas? Thanks! ;)

Link to comment
Share on other sites

Francis,

 

With a lot of help from a fellow OSC'er, I was finally able to get the search box in the header...You will have to "divide" your header into how ever many sections is necessary (mine is the logo, search box and links, a total of three sections). Whatever width your site is set to, divide it by the number of sections...You'll have to define the vertical alignment (valign) as well (for the logo, etc), and of course, set the width.

Getting the search box in there is a bit tricky, so if you want to see my header.php, just send me a PM and I'll work with you on getting yours together.

Link to comment
Share on other sites

jwsfun, what code do you copy and how do you go about putting the search box in the header like on your site?

There are a number of solutions to be found in the forums for doing this. The best that I found is by using the code below. You will need to place it in a table for alignment purposes and change the links to match your site.

 

HTH

 

Jack

 

<form name="quick_find" action="http://www.mycandysupplier.com//shop/catalog/advanced_search_result.php" method="get">

 

<input type="hidden" name="osCsid" value="" />

 

<input type="text" name="keywords" value="Type word(s) and press enter" onFocus="form.keywords.value='';" size="26" maxlength="35" style="">

 

<input type="hidden" name="osCsid" value="">

<A

href="http://www.mycandysupplier.com//shop/catalog/advanced_search.php?osCsid=391a44f07ba9b7c3ff0bbec9676b010e"><B><FONT size=1>Advanced

Search </FONT></B></A></form>

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

Cool, thanks, it's a lot easier in SwishMax or Flash in general than in dreamweaver and fireworks to get the whole search box positioned right... It's not like having to split the graphics up and get all messed up with tables etc., i just need the actual code that is assigned to the search box and the 'go' button so that i can stick it in on my own search box. Check out www.markettown.ie/catalog, it's at the top left of the page. Im not sure what script to use to actually do this with PHP code. It looks like this:

 

on (release) {

    <?php

  $hide = tep_hide_session_id();

  $info_box_contents = array();

  $info_box_contents[] = array('form'  => '<form name="quick_find" method="get" action="' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false) . '">',

                              'align' => 'center',

                              'text'  => $hide . '<input type="text" name="keywords" size="10" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["keywords"])) . '" style="width: ' . (BOX_WIDTH-30) . 'px"> ' . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>'

                              );

  new infoBox($info_box_contents);

?>;

}

 

Thanks for your help, can you PM me your header.php file anyway, just to have a look or stick it up here even?

Link to comment
Share on other sites

Cool, thanks, it's a lot easier in SwishMax or Flash in general than in dreamweaver and fireworks to get the whole search box positioned right...

 

Thanks for your help, can you PM me your header.php file anyway, just to have a look or stick it up here even?

I don't use any of those programs so I don't know how to use them to position anything. Without looking at your code I can't tell you how to add it. But you could just try a trial and error approach. Just insert the code I posted between <tr><td> and </td></tr>. And then find a table (starts with <table ) in your code and insert it all there. If the position is not correct then just move it to some other place. After a few tries you'll begin to see how the positioning works I think.

 

The code I posted isn't in my header.php file since I use STS.

 

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

  • 2 weeks later...

Hi Jeff,

 

I visited your site, nice job. (Off topic, but...) I noticed that your thumbnails are very sharp and clear. What method are you using to create the thumbnails? I'd like my thumbnails to be as nice as that! I look forward to hearing back from you.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...