Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Categories listing


Retard Smith

Recommended Posts

First off, I do not know if this is in the right place, so if it is not, please let me know, and I will move it.

 

On the Categories, in the top left corner of the page, it lists the amount of products in the parenthesis, is there any way to turn this off and not have it list this number?

 

On a seperate note, I have some java classes that create a really nice tree, has anyone tried incorporating java into the osCommerce interface?

 

Thanks,

 

Aaron

Link to comment
Share on other sites

Hi and welcome :D

 

If you take a look at "catalog/includes/boxes/categories.php" you will see:

 

    if (SHOW_COUNTS == 'true') {

     $products_in_category = tep_count_products_in_category($counter);

     if ($products_in_category > 0) {

       $categories_string .= ' (' . $products_in_category . ')';

     }

   }

 

Judging from the if-statement, my guess is one should be able to turn it off somewhere (maybe in the configuration-files) ... if this is not the case, you could for instance replace the categories_string-line with:

 

        $categories_string .= '';

 

... hope that helps. Cheers! :)

Link to comment
Share on other sites

Hi there. In the code it appears as if there is a switch somewhere in the admin console, however if you want a hard coded solution, here's the answer:

 

In /catalog/includes/boxes/categories.php at about Line 50 You'll see the code:

 

	if (SHOW_COUNTS == 'true') {

     $products_in_category = tep_count_products_in_category($counter);

     if ($products_in_category > 0) {

       $categories_string .= ' (' . $products_in_category . ')';

     }

   }

 

Comment this code out, like this:

 

/* disables product counts

if (SHOW_COUNTS == 'true') {

$products_in_category = tep_count_products_in_category($counter);

if ($products_in_category > 0) {

$categories_string .= ' (' . $products_in_category . ')';

}

}

*/

 

This will remove the product count from the category listing.

 

HTH

Regards, Jay.

Link to comment
Share on other sites

The problem with the change Belladonna suggested, is that all you are doing is removing the display from the web-site, however the code will still run. Using my method removes the code completely, and on websites with lots of products/categories, may well count towards a significant reduction in server overhead/processing.

 

Just my tuppence :wink:

 

HTH

Regards, Jay.

Link to comment
Share on other sites

Not that I know of. Why would you want that anyway?

 

If you add a new category then you would have to add that item to your menu.

 

-Al

Link to comment
Share on other sites

Nice work sir, looks much better. Has anyone created a "tree" that is populated only once and would not require the page to be reloaded every time?

 

 

Just turn on the cache....

Unexpect the Expected

Link to comment
Share on other sites

The problem with the change Belladonna suggested, is that all you are doing is removing the display from the web-site, however the code will still run. Using my method removes the code completely, and on websites with lots of products/categories, may well count towards a significant reduction in server overhead/processing.

 

Just my tuppence  :wink:

 

HTH

 

... absolutely right, uncommenting would be better :thumbsup:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...