desi007 Posted May 19, 2007 Share Posted May 19, 2007 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 Quote Link to comment Share on other sites More sharing options...
Guest Posted May 19, 2007 Share Posted May 19, 2007 (edited) 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 May 19, 2007 by enigma1 Quote Link to comment Share on other sites More sharing options...
desi007 Posted May 20, 2007 Author Share Posted May 20, 2007 Dear Mark, Thank you for your reply. But that is not really what i mean. This is my website: http://www.desir.nl/catalog It is the image at the top i want to change if i change category. Is there any way to do that? Desiree Quote Link to comment Share on other sites More sharing options...
Guest Posted May 20, 2007 Share Posted May 20, 2007 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. Quote Link to comment Share on other sites More sharing options...
desi007 Posted May 21, 2007 Author Share Posted May 21, 2007 Sorry Mark, I'm a bit of a newbee, i found the query you were talking about, what should i do with it? Regards, Desiree Quote Link to comment Share on other sites More sharing options...
oschellas Posted May 21, 2007 Share Posted May 21, 2007 (edited) 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 May 21, 2007 by oschellas Quote Link to comment Share on other sites More sharing options...
desi007 Posted May 21, 2007 Author Share Posted May 21, 2007 I copyd your code into my header.php but i get the following error: Parse error: parse error, unexpected $ in /var/www/html/catalog/includes/header.php on line 102 What did i do wrong? Quote Link to comment Share on other sites More sharing options...
desi007 Posted May 21, 2007 Author Share Posted May 21, 2007 Incredible! It's working now. I can't thank you too enough! Thanks very much :lol: Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.