Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Category images - different images for different views


JeremyM

Recommended Posts

Posted

Hello all. Second problem I've had so far with no luck searching...

 

 

Here's my situation: I have a category which has a sub-category and the sub category has a sub-category in itself. Now, I have made custom images when you are viewing the main category and viewing the first wave of sub-categories. Then when you click a sub-category, it puts that image up on the top right to show where you are.

 

Here's my category structure:

 

Main category

->Sub-category A

--> sub-sub-category 1a

--> sub-sub-category 2a

--> sub-sub-category 3a

->Sub-category B

--> sub-sub-category 1b

--> sub-sub-category 2b

--> sub-sub-category 3b

->Sub-category C

--> sub-sub-category 1c

--> sub-sub-category 2c

--> sub-sub-category 3c

 

Now what I want to do is the following: I want to be able to have one image for viewing the list of sub-categories (for each sub-cat) and then when you click on one, have a different image in the top right for that sub-category.

 

Like so:

 

Main category

->Sub-category A Custom image

--> sub-sub-category 1a Custom image of Sub-Cat A but with different graphics for the top right hand corner

--> sub-sub-category 2a Custom image of Sub-Cat A but with different graphics for the top right hand corner

--> sub-sub-category 3a Custom image of Sub-Cat A but with different graphics for the top right hand corner

 

Anyone understand what I'm saying?

Posted

I don't. ;)

 

What do you mean by this statement: "Custom image of Sub-Cat A but with different graphics for the top right hand corner". What's the "top right hand corner" to you?

Contributions

 

Discount Coupon Codes

Donations

Posted

See, when the main category is selected (pic 1), it has just the custom image without the oval.

1.jpg

 

Now when I click a sub category, for instance in this case, 12 Volt Accessories...I want it to have an image just like the main category image. Not the actual category image.

2.jpg

Posted

Ah, so in the second image, that "12-Volt Accessories" needs to be "Car Audio", correct?

 

Try replacing lines 57-69 of index.php with this:

 

<?php
 if ($category_depth == 'nested') {
$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);
$parent_category_query = tep_db_query("select c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$cPath . "' and cd.categories_id = '" . (int)$cPath . "' and cd.language_id = '" . (int)$languages_id . "'");
$parent_category = tep_db_fetch_array($parent_category_query);
?>
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
		<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $parent_category['categories_image'], $parent_category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>
	</table></td>

 

Note I haven't tested this, so make sure to backup your original file.

Contributions

 

Discount Coupon Codes

Donations

Posted

That's not exactly what I meant, however, that might do the trick.

 

I meant, where "Car Audio" is, you see how "12 volt access" comes up? I want the "12 volt access" image to change to one like "car audio" and not have that oval behind it when you are in that category.

Archived

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

×
×
  • Create New...