JeremyM Posted May 17, 2007 Posted May 17, 2007 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?
kgt Posted May 17, 2007 Posted May 17, 2007 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
JeremyM Posted May 18, 2007 Author Posted May 18, 2007 See, when the main category is selected (pic 1), it has just the custom image without the oval. 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.
kgt Posted May 18, 2007 Posted May 18, 2007 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
JeremyM Posted May 18, 2007 Author Posted May 18, 2007 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.
kgt Posted May 18, 2007 Posted May 18, 2007 You can add a categories extra fields contribution and use one of the fields to store that "secondary" image. http://www.oscommerce.com/community/contributions,3173 Contributions Discount Coupon Codes Donations
JeremyM Posted May 18, 2007 Author Posted May 18, 2007 Thanks, I'll give that a try over the weekend. I'll keep you all updated.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.