Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sub Category Indents


jason32835

Recommended Posts

Posted

This has to be an easy fix, but I am stumped!

 

I just need to add indents to subcategories in my category box. I can't upgrade to the better category contribs because I don't want to rework my template.

 

Is there an easy way to add these indents? I am looking in my categories.php but I just can't figure it out.

 

 

Any help would be greatly appreciated!

Posted
This has to be an easy fix, but I am stumped!

 

I just need to add indents to subcategories in my category box. I can't upgrade to the better category contribs because I don't want to rework my template.

 

Is there an easy way to add these indents? I am looking in my categories.php but I just can't figure it out.

Any help would be greatly appreciated!

 

In catalogs/includes/boxes/categories.php find this:

 

	# if subcategory is the one selected, wrap <b> tags round it:
	$categories_string .= '<b>';
	$categories_string .= $tree[$counter]['name'];
	$categories_string .= '</b>';

 

change the middle line to this

$categories_string .= '&npsb;' . '&npsb;' . $tree[$counter]['name'];

 

This will give you a two space indent. Do the same with all other lines that refere to sup-categories.

Just between us, remember there are only 10 kinds of people in the world; those who understand binary and those who don't!!

 

Remember, learning is a "do-it-yourself" experience; although, not necessarily a "do-it-BY-yourself" experience.

 

The quickest way to learn is to forget to BACKUP!

Posted

Hi ComicWisdom.

 

Thank you for the reply, I don't know if it is due to my template, or what, but I made the changes and ran into trouble.

 

Here is my updated code:

 

 $categories_string .= '<tr><TD valign="middle" height="20" align="left" style="padding-left:10px;"><img src="images/marker_cat.gif" width="3" height="5" alt="" style="margin-right:5px;" /><a class="categories" href="';

if ($tree[$counter]['parent'] == 0) {
  $cPath_new = 'cPath=' . $counter;
} else {
  $cPath_new = 'cPath=' . $tree[$counter]['path'];
}

$categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';

if (isset($cPath_array) && in_array($counter, $cPath_array)) {
  $categories_string .= '<b>';
}

// display category name
  $categories_string .= '&npsb;' . '&npsb;' . $tree[$counter]['name'];


if (isset($cPath_array) && in_array($counter, $cPath_array)) {
  $categories_string .= '</b>';
}



$categories_string .= '';


if (SHOW_COUNTS == 'true') {
  $products_in_category = tep_count_products_in_category($counter);
  if ($products_in_category > 0) {
	$categories_string .= '<span class="categories"> , 2;(' . $products_in_category . ')';
  }
}

 

and here is what my category box is doing:

 

&npsb;&npsb;Football

 

&npsb;&npsb;Autographed Footballs

 

&npsb;&npsb;Football Helmets

 

&npsb;&npsb;Football Jerseys

 

&npsb;&npsb;Football Memorabilia - Other

 

&npsb;&npsb;Football Mini Helmets

 

&npsb;&npsb;Football Photos

 

&npsb;&npsb;Basketball

 

&npsb;&npsb;Baseball

 

&npsb;&npsb;Soccer

 

&npsb;&npsb;Hockey

 

&npsb;&npsb;Golf

 

&npsb;&npsb;Boxing

 

&npsb;&npsb;Tennis

 

 

Any further help would be much appreciated!

 

Jason

Posted

lol ... 2 tired guys!

 

you have:

 

$categories_string .= '&npsb;' . '&npsb;' . $tree[$counter]['name'];

 

but it's

 

to shift to the right for indentation ...

 

:-) :-) :-)

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Archived

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

×
×
  • Create New...