Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

New logo in header for each category?


outoftown

Recommended Posts

Posted

Hi everyone :rolleyes:

 

As a graphic designer I have completed some web design in the past and am now working on my first OScommerce site for a succesful artist in London. However, although OScommerce works perfectly in its functionality I am trying to apply some graphical changes and wondered if there is some obvious advice that I could use that I am missing.

 

I have installed a store with a fixed width and a general background graphic in the BODY tag of the main stylesheet; deleted the three shopping cart icaons and replaced the OScommerce logo with a full width graphic ...

 

... what I would like to do is have a different graphic in the header for each category; ie painting, photgraphy, sculpture so that the customer knows exactly which part of the site they are in.

 

I am hoping that there is some kind of 'if' statement that will refer to the category and replace the logo graphic with a named file, but where do I look and place the resulting code?

 

Many thanks in anticipation.

 

Glen

Posted

Unless I misunderstand, or you are using a version of osC that I am not familiar with, this is the out-of-the-box behavior of osC.

 

One small mod that I made here is to display the category name, along with the category image:

 

<td class="pageHeading"><?php echo $category_name; ?></td>

<!-- <td class="pageHeading"><?php //echo HEADING_TITLE; ?></td> -->

 

at index.php, about line #237

For ALL problems, please review this link first -> osCommerce Knowledge Base

Posted
Unless I misunderstand, or you are using a version of osC that I am not familiar with, this is the out-of-the-box behavior of osC.

 

One small mod that I made here is to display the category name, along with the category image:

 

<td class="pageHeading"><?php echo $category_name; ?></td>

<!-- <td class="pageHeading"><?php //echo HEADING_TITLE; ?></td> -->

 

at index.php, about line #237

 

 

Sorry, yes, perhaps my description is misleading. I meant that the logo graphic itself (in my case a 900 pixel wide graphic) can be replaced depending on the category that the viewer is looking.

 

I have tried looking at the if and switch commands on php.net but I probably need to immerse myself in the language a little more than the casual way I usually do things.

 

I just wondered if, in all the stores that exist out there, somebody had done this already and would help save time?

 

Thanks everyone for scratching your head ... a really useful forum with helpful comments and the rarely seen patience with repetitive newbies :thumbsup:

Posted

Find the table cell where the header is rendered in includes/header.php, about line#57, remove the code between the opening and closing tr tags and drop this in:

 

<?php

 $header_image = 'store_logo.png';

 if ($current_category_id) {
$image_q = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
$image_r = tep_db_fetch_array($image_q);
$header_image = $image_r['categories_image'];
 }

?>
 <td width="100%" height="125" background="<?php echo DIR_WS_IMAGES . $header_image; ?>">  </td>

 

Modify the cell attributes as required. This will use your admin supplied category images for the header/banner image. You will also need to modify index.php (and any number of other pages due to repetitious rendering code) at about line #278 to remove the category image placement in the center column body.

 

Enjoy.

For ALL problems, please review this link first -> osCommerce Knowledge Base

Archived

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

×
×
  • Create New...