Jump to content
Sign in to follow this  
willross

Official thread for Great Categories

Recommended Posts

Hi

I have just installed your mod, but it isnt working properly.

 

The categories are all showing, but when clicked the down arrow appears, but no sub categories.

 

see www.sleepingbunnies.com

 

what have I done wrong

 

thanks

 

 

 

ignore the above

 

realised my error

Share this post


Link to post
Share on other sites

Fantastic contribution. :thumbsup: Thank you!

 

I do have one problem though:

 

I am using enable_disable_categories_1.6.1.1

 

My disabled categories still show up in Great Categories.

 

Any idea why?

 

Best Regards, Ted

Share this post


Link to post
Share on other sites

tedmcdonald

 

Does "enable_disable_categories_1.6.1.1" have instructions that modify the categories infobox? If so, it may be applied. It worked for "Multi Stores".


· willross

··········

Share this post


Link to post
Share on other sites
tedmcdonald

 

Does "enable_disable_categories_1.6.1.1" have instructions that modify the categories infobox? If so, it may be applied. It worked for "Multi Stores".

 

Yep, that was it. :D

 

I had to add:

 

// #################### Added Enable / Disable Categories ##############
//  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
 $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' and c.categories_status = '1' order by sort_order, cd.categories_name");
// #################### End Added Enable / Disable Categories ##############

 

to both queries.

 

Best, Ted

Share this post


Link to post
Share on other sites

I need help with changing the link colors just in the categories box. I have installed great categories over STS and have it working perfectly. I have searched for the last three days now trying to find an answer in the forums to this and I keep running into a dead end.

 

I was hoping that I would be able to modify the link colors in the categories box independent from the currently defined <a> in stylesheet.css. Essentially I need a way to define an <a> that works for the categories menu or an <a> that works for the content and footer. My site is white, excluding the menu and the client wants white menu links.... and that won't work as a universal setting. You can see what I mean at www.preciousbabydesigns.com.

 

I am waiting to find a solution before "porting" great categories to the information box. But as soon as I find a solution to this issue, I am done with style on the site and just have to add products and text. Any help would be greatly appreciated.

 

Thanks,

Jen

Share this post


Link to post
Share on other sites

jenamiles

 

 

You could use JavaScript to change the background color of the link text. Go into "categories.php" to around line 47 and find this:

 

$categories_string .= '<td class="categ"><a href="';

 

Replace it with:

 

$categories_string .= '<td class="categ"><a onmouseover="this.style.backgroundColor='CCCCCC';" onmouseout="this.style.backgroundColor='#FFFFFF';" href="';

 

Edit the colors as needed. You could write a class for the <a> too. So, add the class to "stylesheet.css" and replace line 47 with:

 

$categories_string .= '<td class="categ"><a class="newclassforcategories" href="';

 

I am building a new version that will support levels through color. There will be a section in the admin that controls colors, depth, etc. Hope this helps.


· willross

··········

Share this post


Link to post
Share on other sites

jenamiles

 

Add this to "stylesheet.css"

 

TABLE.categ {

border: 0px;

border-spacing: 0px;

font-family: Verdana, Arial, sans-serif;

font-size: 10px;

color: #000000;

}

 

TD.categ {

vertical-align: top;

}

 

A.categ:link { color: #ffffff; }

A.categ:visited { color: #ffffff; }

A.categ:hover { color: #ffffff; }

A.categ:active { color: #ffffff; }

 

Change "#ffffff;" with whatever colors you want.

 

Then replace line 47 in "categories.php" with:

 

$categories_string .= '<td class="categ"><a class="categ" href="';


· willross

··········

Share this post


Link to post
Share on other sites

Hi

just installed the menu think its cool however it works fine with internet explorer but not with opera for some reason ,,,,

and with firefox Mozilla/5.0 the menu cell space seems to double in size.

 

Any help with this would be great thanks.

 

Here is a link to my store My Webpage

Share this post


Link to post
Share on other sites

Hi

just installed the menu think its cool however it works fine with internet explorer but not with opera for some reason ,,,,

and with firefox Mozilla/5.0 the menu cell space seems to double in size.

 

Any help with this would be great thanks.

 

Here is a link to my store My Webpage

 

 

WOOPS my mistake i downloaded 2 differnet versions and forgot to replace the categories.php for the css menu.

THANKS for a great contribution :)

Share this post


Link to post
Share on other sites

TomCavendish

 

Sure you can. Great Categories is very easy to modify. I see that someone took my advice and created a new, multi-color version. I have not yet fully tested it, but it is a good example.

 

Here is some code from that ASP store:

<div class="nav1">

<span id="ucNavL_oDataListMenu"><span>

<a href="default.aspx?act=Ucat_C1">Cutting & Chopping</a>

</span><br><span>

<a href="default.aspx?act=Ucat_C2">Tableware & Serving</a>

</span><br><span>

<a href="default.aspx?act=Ucat_C3">Stovetop & Ovenware</a>

</span><br><span>

<a href="default.aspx?act=Ucat_C4">Coffee & Tea</a>

</span><br><span>

<a href="default.aspx?act=Ucat_C5">Kitchen Utensils</a>

</span><br><span>

<a href="default.aspx?act=Ucat_C6">Wine & Barware</a>

</span><br><span>

<a href="default.aspx?act=Ucat_C7">Kitchen Electrical</a>

</span><br><span>

<a href="default.aspx?act=Ucat_C8">Weighing & Measuring</a>

</span><br><span>

<a href="default.aspx?act=Ucat_C9">Celebrity Chef Ranges</a>

</span><br><span>

<a href="default.aspx?act=Ucat_C10">Cookbooks & Recipes</a>

</span><br><span>

<a href="default.aspx?act=Ucat_C11">Outdoor Entertaining</a>

</span><br><span>

<a href="default.aspx?act=Ucat_C12">Kitchen Storage</a>

</span></span>

</div>

It does not display sub-categories. To get the "look" of that menu, just examine the CSS and apply it to "categories.php". Fool around with it. You may end up with a cool new version.

 

I have a multi-color version that has Multi Stores and a few other contributions that can be enabled/disabled via admin. I am waiting for MS3 or MS4 to be released before providing it.


· willross

··········

Share this post


Link to post
Share on other sites
TomCavendish

 

Sure you can. Great Categories is very easy to modify. I see that someone took my advice and created a new, multi-color version. I have not yet fully tested it, but it is a good example.

 

Here is some code from that ASP store:

<div class="nav1">

<span id="ucNavL_oDataListMenu"><span>

<a href="default.aspx?act=Ucat_C1">Cutting & Chopping</a>

</span><br><span>

<a href="default.aspx?act=Ucat_C2">Tableware & Serving</a>

</span><br><span>

<a href="default.aspx?act=Ucat_C3">Stovetop & Ovenware</a>

</span><br><span>

<a href="default.aspx?act=Ucat_C4">Coffee & Tea</a>

</span><br><span>

<a href="default.aspx?act=Ucat_C5">Kitchen Utensils</a>

</span><br><span>

<a href="default.aspx?act=Ucat_C6">Wine & Barware</a>

</span><br><span>

<a href="default.aspx?act=Ucat_C7">Kitchen Electrical</a>

</span><br><span>

<a href="default.aspx?act=Ucat_C8">Weighing & Measuring</a>

</span><br><span>

<a href="default.aspx?act=Ucat_C9">Celebrity Chef Ranges</a>

</span><br><span>

<a href="default.aspx?act=Ucat_C10">Cookbooks & Recipes</a>

</span><br><span>

<a href="default.aspx?act=Ucat_C11">Outdoor Entertaining</a>

</span><br><span>

<a href="default.aspx?act=Ucat_C12">Kitchen Storage</a>

</span></span>

</div>

It does not display sub-categories. To get the "look" of that menu, just examine the CSS and apply it to "categories.php". Fool around with it. You may end up with a cool new version.

 

I have a multi-color version that has Multi Stores and a few other contributions that can be enabled/disabled via admin. I am waiting for MS3 or MS4 to be released before providing it.

 

Trouble is I don't know how/where to put the <div class="nav1"> into my code for boxes/categories.php

 

Here's my categories.php

 

<?php
/*
 $Id: categories.php,v 1.23 2002/11/12 14:09:30 dgw_ Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License
*/

 function tep_show_category($counter) {
global $foo, $categories_string, $id, $aa;

for ($a=0; $a<$foo[$counter]['level']; $a++) {
  if ($a == $foo[$counter]['level']-1)
	  {
	$categories_string .= "<font color='#ff0000'></font>";
 	} else
		  {
		  $categories_string .= "<font color='#ff0000'></font>";
 		}

	}
if ($foo[$counter]['level'] == 0)
{
	if ($aa == 1)
	{
	$categories_string .= "<hr>";
	}
	else
	{$aa=1;}

}



$categories_string .= '<nobr><a nowrap href="';

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

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

if ( ($id) && (in_array($counter, $id)) ) {
  $categories_string .= "<b><font color='#ff0000'>";
}

// display category name
$categories_string .= $foo[$counter]['name'];

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

  // if (tep_has_category_subcategories($counter)) {
  //   $categories_string .= '->';
  // }

$categories_string .= '</nobr></a>';

  // if (SHOW_COUNTS == 'true') {
  //   $products_in_category = tep_count_products_in_category($counter);
  //   if ($products_in_category > 0) {
  //	 $categories_string .= ' (' . $products_in_category . ')';
  //   }	}

$categories_string .= '<br>';

if ($foo[$counter]['next_id']) {
  tep_show_category($foo[$counter]['next_id']);
}
 }
?>
<!-- categories //-->
	  <tr>
		<td>
<?php
 $aa = 0;
 $info_box_contents = array();
 $info_box_contents[] = array('align' => 'left',
						   'text'  => BOX_HEADING_CATEGORIES
						  );
 new InfoBoxHeading($info_box_contents, true, false);

 $categories_string = '';

// add links to products with no category
 $product_query = tep_db_query("select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = 0 and p.products_id = pd.products_id and pd.language_id ='"  . (int)$languages_id . "' order by pd.products_name " );
 while ($no_category = tep_db_fetch_array($product_query))  {
	$no_cat_product_id = $no_category['products_id'];
	$no_cat_products_name = $no_category['products_name'];
$myref = "<a href=" . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $no_cat_product_id) . '>' . $no_cat_products_name . '</a><br><br>';
$categories_string .= $myref;
}
 // end links to products with no category

 

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");

while ($categories = tep_db_fetch_array($categories_query)) {

$foo[$categories['categories_id']] = array(

'name' => $categories['categories_name'],

'parent' => $categories['parent_id'],

'level' => 0,

'path' => $categories['categories_id'],

'next_id' => false

);

 

if (isset($prev_id)) {

$foo[$prev_id]['next_id'] = $categories['categories_id'];

}

 

$prev_id = $categories['categories_id'];

 

if (!isset($first_element)) {

$first_element = $categories['categories_id'];

}

}

 

//------------------------

if ($cPath) {

$new_path = '';

$id = split('_', $cPath);

reset($id);

while (list($key, $value) = each($id)) {

unset($prev_id);

unset($first_id);

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $value . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_name");

$category_check = tep_db_num_rows($categories_query);

if ($category_check > 0) {

$new_path .= $value;

while ($row = tep_db_fetch_array($categories_query)) {

$foo[$row['categories_id']] = array(

'name' => $row['categories_name'],

'parent' => $row['parent_id'],

'level' => $key+1,

'path' => $new_path . '_' . $row['categories_id'],

'next_id' => false

);

 

if (isset($prev_id)) {

$foo[$prev_id]['next_id'] = $row['categories_id'];

}

 

$prev_id = $row['categories_id'];

 

if (!isset($first_id)) {

$first_id = $row['categories_id'];

}

 

$last_id = $row['categories_id'];

}

$foo[$last_id]['next_id'] = $foo[$value]['next_id'];

$foo[$value]['next_id'] = $first_id;

$new_path .= '_';

} else {

break;

}

}

}

tep_show_category($first_element);

 

$info_box_contents = array();

$info_box_contents[] = array('align' => 'left',

'text' => $categories_string

);

 

// WebMakers.com Added: All products or All Products Multiple Purchase

// new infoBox($info_box_contents);

 

// WebMakers.com Added: Show All Products Listing

if (SHOW_ALL_PRODUCTS_BOX=='1') {

$info_box_contents[] = array('align' => 'center" valign="top',

'text' => '<hr><a href="' . tep_href_link(FILENAME_ALLPRODS, '', 'NONSSL') . '">' . BOX_INFORMATION_ALLPRODS . '</a>');

}

 

// WebMakers.com Added: Show multiple product listing add for all products

if (SHOW_PRODUCT_LISTINGS_MULTI_ADD_BOX=='1') {

// All Products Multiple Purchase

 

$info_box_contents[] = array('align' => 'center" valign="top',

'text' => '<hr><a href="' . tep_href_link(FILENAME_PRODUCTS_ALL, '', 'NONSSL') . '">' . BOX_INFORMATION_PRODUCT_ALL . '</a>');

}

 

new InfoBox($info_box_contents);

 

?>

</td>

</tr>

<!-- categories_eof //-->

[/code]

Edited by TomCavendish

Share this post


Link to post
Share on other sites

TomCavendish

 

I would start by downloading the CSS and a page or two from that store to see how the navigation really works. Then download a copy of either Great Categories Classic or the CSS Edition. Compare the HTML between the two and improvise. You won't be able to just drop in this division. The above two contributions will get you started.

 

Make up a test site and start messing with it. Break it! Then you will really see how it works. Keep me updated and I will try to assist.


· willross

··········

Share this post


Link to post
Share on other sites
TomCavendish

 

I would start by downloading the CSS and a page or two from that store to see how the navigation really works. Then download a copy of either Great Categories Classic or the CSS Edition. Compare the HTML between the two and improvise. You won't be able to just drop in this division. The above two contributions will get you started.

 

Make up a test site and start messing with it. Break it! Then you will really see how it works. Keep me updated and I will try to assist.

 

Actually, this contribution did just what I wanted after all.

 

TIP: To give the cleaner look I simply didn't upload the arrow gif's etc. and did a few tweaks with the css.

 

Many thanks to those who worked on this! :thumbsup:

Share this post


Link to post
Share on other sites

OMG!!

 

i think i just died!

 

this is a really cool contrib, but i cannot get it working.. i have installed this before on a diffrfent store.

 

but this one WILL NOT work!!

 

can someone please please look at my site or something and see what i am doing wrong..

 

i have downloaded the most recent version, placed "categories.php" in my directory, overwriting the old one.

 

added the CSS tags to my stylesheet..

but nothing changes..

 

i try other stylesheets, old versions of categories.php (that is used to work on) and no changes ever appear on my product navs..

 

my URL is http://www.jimborgmanconstruction.com/welcome

 

can you please tell me if you see ANYTHING i am doing wrong?

 

thank you.

Edited by skenagle

Share this post


Link to post
Share on other sites

I have installed the newest version of great contribution and think its great. But i have one problem. I dont now how to fix it.

 

In the categories i get an big jump between the lines, is there somehow to fix this?

 

I want the menu to be like the original oscommerce menu but with with to images, one for the main categories and one for the subcategories. like on the picture.

 

Also i put in an image of the categories

categori.jpg

 

 

-Thomas-

Edited by bongo

Share this post


Link to post
Share on other sites

hey everyone..

 

just like everyone else i love this contrib..

 

but i have a question:

 

Do you think it would be possible to make the css operate like the image i have atatched?

 

(looking at the light blue)

 

its basically.. after it expands the initial category, it colorizes every active sub Category down.

 

so sites with many category layers (like mine) :) will always show the customer clearly where they are.

 

???? any ideas????

 

csscats-idea.gif

 

OMG!!

 

i think i just died!

 

this is a really cool contrib, but i cannot get it working.. i have installed this before on a diffrfent store.

 

but this one WILL NOT work!!

 

can someone please please look at my site or something and see what i am doing wrong..

 

i have downloaded the most recent version, placed "categories.php" in my directory, overwriting the old one.

 

added the CSS tags to my stylesheet..

but nothing changes..

 

i try other stylesheets, old versions of categories.php (that is used to work on) and no changes ever appear on my product navs..

 

my URL is http://www.jimborgmanconstruction.com/welcome

 

can you please tell me if you see ANYTHING i am doing wrong?

 

thank you.

 

 

BTW... figured this one out...

 

for anyone else who needs to know this..

 

My categories.php was not even being called, the template i used had teh categories.php code built into the header.php file.

 

hmmm .. news to me!!

 

...

Share this post


Link to post
Share on other sites

How can I fix this for catagories that go deeper then the #fifthcat? It seems to break if it goes any deeper then 5 catagories deep. Please take a look at this:

 

http://induk.opticnrg.com/catalog/index.ph...=24_54_67_88_90

 

For kicks I just tried adding #sixthcat to the stylesheet but that didn't do anything.

 

Thanks for the help and a really good contribution!

 

 

Dang it - I honestly don't think my brain starts problem solving until I actually post my question. I got it figured out.

 

For future people that run into this issue: Open up the includes/boxes/catagories.php and add this line -

 

if ($tree[$counter]['level'] == 5) {$categories_string .= '<div id="sixthcat">';}

 

around line number 34. So in the end it looks like this:

 

if ($tree[$counter]['level'] == 0) {$categories_string .= '<div id="topcat">';}

if ($tree[$counter]['level'] == 1) {$categories_string .= '<div id="secondcat">';}

if ($tree[$counter]['level'] == 2) {$categories_string .= '<div id="thirdcat">';}

if ($tree[$counter]['level'] == 3) {$categories_string .= '<div id="fourthcat">';}

if ($tree[$counter]['level'] == 4) {$categories_string .= '<div id="fifthcat">';}

if ($tree[$counter]['level'] == 5) {$categories_string .= '<div id="sixthcat">';}

 

Hope that helps anyone...

Share this post


Link to post
Share on other sites

Willross,

 

I have a question about this.

 

When I go to the site:

http://shoptoo.palaia.us/category202/default.html

 

And look at "Fine Double Thick Cover" -- yours is nice and indented the way it should be...

 

Now look at this site, please:

 

http://www.thebestcandles.com/novelty-candles-c-24.html

 

See where it says "Baby Bottle Candles"? How come that's not indented the same nice, clean way?

 

Thanks for an awesome contribution! :)

 

Pete


I find the fun in everything.

Share this post


Link to post
Share on other sites

Well I guess that answers that! Note to self. The CSS version isn't nearly as neat and clean as the non-CSS version.

 

2 Questions

 

1) Anyone out there make the CSS version nice and clean (indents, etc.) as the non?

 

2) Is the only way to change the button color to "make" new ones via PhotoShop or similar? Or is there something I can "set" somewhere? Thanks, I'm kind of new to this. ;)

 

Thanks,

 

Pete


I find the fun in everything.

Share this post


Link to post
Share on other sites

Will Ross, thanks. This is one of the best contributions I have seen on this board!

 

I am working against time for the new year, and I am sure I will meet the time and spec requirements.

 

Have installed the seperate_colors_for_great_categories and looks great indeed. Works well with a wide variety of product range....

 

I however have two problems.

 

a. The subcategories are not showing in the box, though thox shows up.

b. Cant figure out why some thema images are not showing up.

 

Any Ideas around each of these?

 

Tony

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×