Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Replacing Zen Cart banner with an HTML Header file?

Replacing Zen Cart banner with an HTML Header file?

Locked

Views: 2,415

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
8 Dec 2009, 6:01 PM
#1
robertg avatar

robertg

Zen Follower

Join Date:
Nov 2009
Posts:
341
Plugin Contributions:
0

Replacing Zen Cart banner with an HTML Header file?

Should I use the overide system to allow me to do that.

This is the code within my header2.html file

"<div align="right">

<table width="200" border="0" align="right" cellpadding="0" cellspacing="0" class="smallfont"> <tr> <td class="smallpad" width="200" align="right" valign="middle"> <a><div align="centre"><img src="http://www.newstore/cart.png"> <a style="color: #FFFFFF;" href="cart.php">Shopping Cart</a> </td> </tr> <tr> <td width="200" height="2" align="right"><img src="images/headivider.gif" width="200" height="2"></td> </tr> <tr> <form name="form1" method="post" action="products.php?action=search"> <td class="smallpad" width="200" align="right" valign="middle"> <font color="#FFFFFF">Product Search:</font><br> <input name="search_data" type="text" class="header" size="16" maxlength="40"> <input name="Submit" type="submit" class="go" value="Go!">"

I've been attempting to work this for over a week now, I have everything else done but the header/banner

Thanks in advance for your help.

8 Dec 2009, 7:10 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Replacing Zen Cart banner with an HTML Header file?

If you want to use custom coding, you would use the override system. Copy /includes/templates/template_default/common/tpl_header.php to /includes/templates/your_template/common/tpl_header.php, and edit that one.

Just curious, why do you want to write all-new code for search in header when there is an existing module for that? You could put your image in the header or logo, and move the search box where you want it, without changing the tested stock code.

8 Dec 2009, 9:05 PM
#3
robertg avatar

robertg

Zen Follower

Join Date:
Nov 2009
Posts:
341
Plugin Contributions:
0

Re: Replacing Zen Cart banner with an HTML Header file?

I am going to use the existing search. The code is from my existing working site. it comes with a search code but I will remove it.
So based on what your saying is that all I have to do is change the code in the existing file. That's where my problem arises i'm not sure as to what files I have to change.
Past experience has caused me a lot of problems with properly locating it on or i the Header/Banner,
I'm trying to replace replace the powered by Zen cart logo and the
Sales message goes here text with my logo an header file.
See https://www.thetrailingedge.com thats the header I want to use.
Thanks for your input, it is greatly appreciated

11 Dec 2009, 6:02 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Replacing Zen Cart banner with an HTML Header file?

This tutorial describes how to change the logo: https://www.zen-cart.com/tutorials/index.php?article=125

Neither the cart nor search code will work in Zen Cart, as they refer to files from your old cart.

You can copy the existing search box to a spot right after```php

<!--bof-branding display--> <div id="logoWrapper"> <div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div> ``` ```php <div id="navMainSearch"><?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div> ```and put your own content around it. ```php <div id="customSearchHeader">Product Search: <div id="navMainSearch"><?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div> </div> ``` The cart/header is available in Free Addons, and you can put the code for that just above the customSearchHeader div.

Then you can style both of those in the stylesheet, with float: right; and some other properties as required (like headivider.gif as a background at the top of the search div). If you do the PHP code changes, I can advise on tweaking the styling.