Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Official thread for Great Categories


willross

Recommended Posts

This is the support thread for Great Categories:

 

http://www.oscommerce.com/community/contributions,2802

 

Here are two sites that currently use this contribution:

 

http://shoptoo.palaia.us/

http://shop.gwerx.com/

 

The first one also uses a mod_rewrite system that has greatly impacted it's SEO performance.

· willross

··········

Link to comment
Share on other sites

  • Replies 177
  • Created
  • Last Reply

Top Posters In This Topic

Sorry I'm obviously a bit slow today. The bottom site seems to came a new approach to categores but the top site seemed the same as any other at first glance. Can you explain what this contribution does? I've read the description in the contributions section but I'm none the wiser.

Link to comment
Share on other sites

radders,

The first site uses a mod_rewrite system that has greatly improved the SEO performance. It went from off the list (no. 500+) to the top five in two months. This is not the contribution for this thread. It is Great Categories. 'Great' meaning I like it a lot. It is a simple, but easy way to organize your categories. I believe that it is easier to read that the 'stock' version. that's all.

 

dailce,

It can be done. The problem is in the sorting and potential for large# of products listed in the box. You could also use CSS to change colors for sub-sub categories.

· willross

··········

Link to comment
Share on other sites

I love this contribution and have been looking for something jsut like this for almost a year now. The problem I have is that the text comes out way to be. I have checked my css and there does not seem to be anything there controlling the size of this particular text. Can you give me a clue?

Link to comment
Share on other sites

Hi

I want to use this contrib, but have multi stores installed which has edited two lines in the catagorpes.php file.

I've tried simply applying those two edits, but when I do, all I get is an empty box with a category count in it. (This is also all I get without the edits applied.)

 

If I post the existing categories.php code here, can you show me how to change it to get the two contribs working together please?

Link to comment
Share on other sites

bsbadeaux

I personally set my boxes to 145px. The default is 125px. as far as the css, it is case-sensative in UNIX so I would look there (ie 'smallText' instead of 'smalltext'). Also try refreshing your browser's cache. The css is as follows:

 

TABLE.categ {

border: 0px;

border-spacing: 0px;

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

font-size: 10px;

color: #000000;

}

 

TD.categ {

vertical-align: top;

}

 

gail

I am not familiar with the multi-stores package, but will check it out. Feel free to put the code here too.

· willross

··········

Link to comment
Share on other sites

gail

I am not familiar with the multi-stores package, but will check it out. Feel free to put the code here too.

 

Thanks

Here is the catagoeries.php code with the multi stores edits highlighted in red

 

 

 

<?php

/*

$Id: categories.php,v 1.25 2003/07/09 01:13:58 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

function tep_show_category($counter) {

global $tree, $categories_string, $cPath_array;

 

for ($i=0; $i<$tree[$counter]['level']; $i++) {

$categories_string .= "  ";

}

 

$categories_string .= '<a 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 .= $tree[$counter]['name'];

 

if (isset($cPath_array) && in_array($counter, $cPath_array)) {

$categories_string .= '</b>';

}

 

if (tep_has_category_subcategories($counter)) {

$categories_string .= '->';

}

 

$categories_string .= '</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 ($tree[$counter]['next_id'] != false) {

tep_show_category($tree[$counter]['next_id']);

}

}

?>

<!-- categories //-->

<tr>

<td>

<?php

$info_box_contents = array();

$info_box_contents[] = array('text' => BOX_HEADING_CATEGORIES);

 

new infoBoxHeading($info_box_contents, true, false);

 

$categories_string = '';

$tree = array();

//rmh M-S_multi-stores edited next line

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

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

$tree[$categories['categories_id']] = array('name' => $categories['categories_name'],

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

'level' => 0,

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

'next_id' => false);

 

if (isset($parent_id)) {

$tree[$parent_id]['next_id'] = $categories['categories_id'];

}

 

$parent_id = $categories['categories_id'];

 

if (!isset($first_element)) {

$first_element = $categories['categories_id'];

}

}

 

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

if (tep_not_null($cPath)) {

$new_path = '';

reset($cPath_array);

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

unset($parent_id);

unset($first_id);

//rmh M-S_multi-stores edited next line

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

if (tep_db_num_rows($categories_query)) {

$new_path .= $value;

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

$tree[$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($parent_id)) {

$tree[$parent_id]['next_id'] = $row['categories_id'];

}

 

$parent_id = $row['categories_id'];

 

if (!isset($first_id)) {

$first_id = $row['categories_id'];

}

 

$last_id = $row['categories_id'];

}

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

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

$new_path .= '_';

} else {

break;

}

}

}

tep_show_category($first_element);

 

$info_box_contents = array();

$info_box_contents[] = array('text' => $categories_string);

 

new infoBox($info_box_contents);

?>

</td>

</tr>

<!-- categories_eof //-->

 

 

I appreciate your help with this one, it's a bit beyond my basic php skills.

Link to comment
Share on other sites

Ok first off, willross, amazing work man.

 

I was actually planning on changing the looks somehow as I thought the standard setup looked rather unprofessional, buy hey you saved me the work and did a good job of it.

 

All this aside from the fact that I'm sure it would have taking me a lot more work than it took you since I really don't know all that much about the code.

 

But on to the real reason of my post. As you suggested I don't want to show the number of products next to the category name, and I'm to tired/dense to look through the code and figure out how to change it.

 

Suggestions please.

 

Thanks a ton.

Link to comment
Share on other sites

gail

I still need to set-up a shop with the multi-store contribution. Then I can see how it displays and try to solve the problem. It may take a week or so...

 

Gidgidonihah

You can shut off the product counts in the 'Configuration' page in the admin. Set 'SHOW_COUNTS' to false.

· willross

··········

Link to comment
Share on other sites

  • 3 weeks later...

Hello,

the contrib ist not working togehter with the email-validation contrib.

After valiadation on the left side will be errors destroying the layout.

 

Could be that the error is in front of my keyboard :-) , but I checked it on a clean OSC.

 

Michael

Link to comment
Share on other sites

I figured it out.

 

The problem is $id.

 

The email-validation contrib sends id with a GET, so it gets to $id.

 

I just rename every $id with $idd.

 

This solved the problem.

 

There could be a better solution, but it works.

 

Michael

Link to comment
Share on other sites

It is a problem of both together.

The email valiadation contrib uses ID in the http-GET statement.

OSC builds from the GET variable ID the variable $ID.

 

So in the great categories the $ID an the $id inside the script are the same, This crashes the script. Just a rename of $id in the great catagories solves the problem.

 

The same could be solved by midification of the email validation code, but it is more complex.

 

Michael

Link to comment
Share on other sites

Nice job on the contribution.

 

Ever run accross this error?

 

Warning: in_array(): Wrong datatype for second argument in /home/gatorla/public_html/store/includes/boxes/categories.php on line 31

 

These are multiple errors in a row on the left hand side right above the categories menu. The categories menu gets shoved downward and all you see is the errors. Is it caused by your contribution or something else?

 

Mike

Link to comment
Share on other sites

bugauto

 

I have yet to encounter an error from this contribution. The only issues I have seen were due to incompatibility with 2 other contributions that came out later than this one. This categories infobox was originally made for the Exchange Project in 2000 - 2001. I updated it and posted in January. I'd say it's pretty stable.

 

I will investigate your problem. A new version is in the works that should cover all issues and add a few features too.

· willross

··········

Link to comment
Share on other sites

bugauto

 

I have yet to encounter an error from this contribution. The only issues I have seen were due to incompatibility with 2 other contributions that came out later than this one. This categories infobox was originally made for the Exchange Project in 2000 - 2001. I updated it and posted in January. I'd say it's pretty stable.

 

I will investigate your problem. A new version is in the works that should cover all issues and add a few features too.

 

That's cool. I mainly wanted to find out if you have seen that error before and how you took care of it.

 

That's cool too on the upcoming new version. One thing I can suggest is when there is sub-categories that have sub-categories and so on they need to be distinguished somehow differently from the upper sub-category, because it all kind of blends in with sub-categories below and looks like it is part of that category. I may not be very clear so I will show you what I mean.

 

As you can see this is the electrical main category which has sub-categories. The sub-categories have sub-categories. Notice not all sub-categories have sub-categories. When that happens the sub-categories with in the main electrical category that are beneath the sub-category that has other sub-categories looks like it is part of the sub-category right above it.

 

cat1.gif

 

 

 

cat2.gif

 

When you click on Tune-Up parts the sub-categories are

Caps

Condensers

Points

Rotors

Spark Plugs - Wires

 

but it looks like Starters, and Switches is part of it but it's not. Those two are just sub-categories of the main electrical category.

 

I noticed a post above where you mentioned taking care of this kind of thing with css. So color coding the specific sub-categories is my guess. Is that what you think too? Or would there be an other way that might be nicer and cleaner?

 

Mike

Link to comment
Share on other sites

bugauto

 

Different color or additional horizontal bars can be added to further separate the inner sub-categories. CSS could also be used. The problem is that the category arrangement and volume vary from store to store. Also, I am looking at compatibility with other contributions.

 

Hey, mess with it. If it works, share it. Otherwise, a stack of other work is keeping me away from this for most of April.

· willross

··········

Link to comment
Share on other sites

  • 2 weeks later...

Nice contribution. I see where you can add more content/images to break up the sub categories. I have a store that needed it and two that don't. No problems yet either and I have quite a bit installed. I'll keep checking back on this one...

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...

Ive installed this contribution and added the neccessary info to the stylesheet - however the text in the menu shows as a different size on the index page as compared to the text size in the menu on all other pages.

 

I have tried it on a fresh install of OSCommerce - with the exact same results.

 

Any ideas?

Edited by melfalcon15
Link to comment
Share on other sites

Ive installed this contribution and added the neccessary info to the stylesheet - however the text in the menu shows as a different size on the index page as compared to the text size in the menu  on all other pages.

 

I have tried it on a fresh install of OSCommerce - with the exact same results.

 

Any ideas?

 

hmm..

I'm not seeing that. Check http://www.perfectuniforms.com

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...