Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Heading image depending on category


desi007

Recommended Posts

Dear Oscommerce users,

 

I'm now really getting a nice webshop, but there is still one thing i'm not finding a solution for.

I hope you can help me out!

 

Problem

I would like to be able to change the heading image at the top depending on in which category the customer is.

 

ie. i have a shop with womans jewelry, but i the customer clicks on the category for mens jewelry i want another top image.

 

Does somebody know how to accomplish this? Or is there a contrib for it?

 

Any help would be very appreciated!

 

Thanks.

 

Desiree

Link to comment
Share on other sites

With osCommerce - by default each category can accomodate a single image. So you should be able to assign an image for each category from your osc Admin. And it's a simple modification (html mainly) to position the categories image where you want it (see catalog\index.php)

 

Check it with the demo store

http://demo.oscommerce.com

for each category on the right hand side of the header there is a different image.

Edited by enigma1
Link to comment
Share on other sites

That is what I am saying. You assign images for each category. Then you output the image from the header.php.

 

Ok now the query you need to change takes place in the index.php

 

Here's the one with nested categories:

 

	$category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
$category = tep_db_fetch_array($category_query);

 

So that code along with the condition has to be moved before the header in index.php. So the categories_images is available and can be controled by the header.php. It's a bit of work but it's straight-forward to do.

Link to comment
Share on other sites

If your categories are fixed and don't change a lot you could hard code it in the header, something like:

 

<?php if($_GET['cPath'] == '30'){ ?>
<EMBED src="http://www.desir.nl/catalog/images/exclusive.swf" width="798" height="200" quality=high bgcolor=#000000
NAME="browser" ALIGN="center" TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
<?php } elseif($_GET['cPath'] == '21') { ?>
<EMBED src="http://www.desir.nl/catalog/images/parel.swf" width="798" height="200" quality=high bgcolor=#000000
NAME="browser" ALIGN="center" TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
<?php } 

enzovoort...

else { ?>
<EMBED src="http://www.desir.nl/catalog/images/topstars.swf" width="798" height="200" quality=high bgcolor=#000000
NAME="browser" ALIGN="center" TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
<?php } ?>

Edited by oschellas
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...