Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

displaying subcategories horizontally


skarra

Recommended Posts

I have been trying to display the subcategories in a horizontal row underneath the selected category in the infobox.

 

It needs to display like this:

 

2003 ->  

 1  2  3  4

2004 ->

2005 ->

 

I just can't work and out how to put a line break <br> after the final subcategory is listed.

 

this is what I currently get:

 

2003 ->

 1  2  3  4 2003 ->

2004 ->

 

any help would be fantastic :lol:

Dave

Link to comment
Share on other sites

In includes/boxes/categories.php the tep_show_category function (MS2 version) ends with

    $categories_string .= '<br';



   if ($tree[$counter]['next_id'] != false) {

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

   }

just before the final closing curly bracket for the function. The MS1CVS versions may have the same thing but using $foo.

Change these four lines to read

    if ($tree[$counter]['next_id'] != false) {

     if (($tree[$tree[$counter]['next_id']]['parent'] == 0) || ($tree[$counter]['parent'] == 0)) {

       $categories_string .= '<br>';

     }

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

   }

or the $foo equivalent.

Regards, Wizzud

"It is better to remain silent and be thought a fool, than to open your mouth and remove all doubt."

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...