Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How do you change the color of the selected category?


awesomized

Recommended Posts

Posted

By default the selected category is bold black. Is there a way to change the color of a category when it is selected? It doesn't seem like this can be done in the style sheet and I can't figure out where the code is that is currently changing it to bold when it's selected.

 

Also, is there a way to make the main parent categories bold without being selected? I know that I can do this in the style sheet, BUT that will also make the sub categories bold and I only want the main categories bold. Is that possible?

 

I'm new at all this, so I would appreciate any help. Thanks.

Posted

I figured out how to change the color, so I'll share how I did it for if anyone else is interested....

 

I changed this...

if ($in_path) {
				$categories_string .=  '<b>';
			}
			$categories_string .=  $foo[$cid]['name'];
			if ($in_path)
				$categories_string .=  '</b>';

to this...

if ($in_path) {
				$categories_string .=  '<b><font color="009999">';
			}
			$categories_string .=  $foo[$cid]['name'];
			if ($in_path)
				$categories_string .=  '</b></font>';

by adding font color tags next to the bold tags.

 

I still can't figure out how to make only the parent categories bold and the sub categories in plain text. Does anyone know how to do that?

  • 1 month later...
Posted

I think the routines for creating categories that you're talking about are in /includes/functions/general.php

for example:

  function tep_get_subcategories(&$subcategories_array, $parent_id = 0) {
$subcategories_query = tep_db_query("select categories_id from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$parent_id . "'");
while ($subcategories = tep_db_fetch_array($subcategories_query)) {
  $subcategories_array[sizeof($subcategories_array)] = $subcategories['categories_id'];
  if ($subcategories['categories_id'] != $parent_id) {
	tep_get_subcategories($subcategories_array, $subcategories['categories_id']);
  }
}
 }

But I don't know enough about php to say whether what you want is possible.

Archived

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

×
×
  • Create New...