Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How can I update to always show subcategories?


kristal

Recommended Posts

Posted

What can I change in the category box to make it always show all the sub-categories; and also not have the main category clickable (because the sub categories will already be shown).

Posted

I am looking for something similar too, but I want the sub cat images to appear on every page as per the page you go into ie on DVDs where it says Action, Drama, Comedy...

 

What can I change in the category box to make it always show all the sub-categories; and also not have the main category clickable (because the sub categories will already be shown).
Posted
What can I change in the category box to make it always show all the sub-categories; and also not have the main category clickable (because the sub categories will already be shown).

 

Does anyone know how to do this?? Please? At least just show all sub cats always?

Posted

if you know a bit of programming edit your catalog\includes\boxes\categories.php, you will find something like

 

  if (tep_not_null($cPath)) {
$new_path = '';
reset($cPath_array);
while (list($key, $value) = each($cPath_array)) {

 

This the condition for the code to include the subcategores. It relies on the cPath parameter to be set. So instead of using cPath you use the tep_get_categories() function which returns the category id of each category. Call it like tep_get_categories() and will return an array of all categories with their ids. So you remove the "if" restriction from the code above and in the while loop instead of using the $cPath_array you use the array that came back from that function.

 

That's a possible solution anyways.

Posted
if you know a bit of programming edit your catalog\includes\boxes\categories.php, you will find something like

 

  if (tep_not_null($cPath)) {
$new_path = '';
reset($cPath_array);
while (list($key, $value) = each($cPath_array)) {

 

This the condition for the code to include the subcategores. It relies on the cPath parameter to be set. So instead of using cPath you use the tep_get_categories() function which returns the category id of each category. Call it like tep_get_categories() and will return an array of all categories with their ids. So you remove the "if" restriction from the code above and in the while loop instead of using the $cPath_array you use the array that came back from that function.

 

That's a possible solution anyways.

 

Thanks so much for trying to help. :) I understand the basics of what you are saying, but I'm not sure how to go about writing it.. I've never written any code before; I'm a bit of a newbie. :blush:

Posted
Hmmmm.. I checked out the contribution here:

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

 

and all they give you is a all_categories.php file... what do I do with that? lol Theres no instructions on how to update any other files to include this file.. ???

 

I just change the name to categories.php and replace the original one. It works well.

 

Ganxh

Posted
I just change the name to categories.php and replace the original one. It works well.

 

Ganxh

 

Thanks, What folder does it go in?

Archived

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

×
×
  • Create New...