View Single Post
  #70  
Old 02-20-2008, 07:29 AM
 
robertswww robertswww is offline
 

X-Adept
  
Join Date: Jul 2003
Posts: 586
 

Default Re: ALWAYS display first level subcats beneath root cats

Quote:
Originally Posted by Jeremy.Freeman
Fixed it.. you need to comment out the following line in include/categories.php to sort the subcategories by pos:

usort($all_categories, "func_categories_sort");

I should appear around line 165ish

If you comment out that line, the subcategories will then sort by the Position Number you specify and not alphabetically. However, it will mess up the category order on the back end, which makes it more difficult to add a new product to the correct category/categories.

4.0.x Solution:

Only have the subcategories sorted by position number on the customer front-end by putting the usort in an IF statement as follows...
(Note: it's around Line 164 (4.0.19) and Line 171 (4.1.9) in my include/categories.php file)
Code:
if($current_area != 'C') { usort($all_categories, "func_categories_sort"); }
4.1.x Solution:
First, follow Post #22 in this same thread (on page 3):
http://forum.x-cart.com/showpost.php?p=124458&postcount=22

Next, notice the usort is now uasort in the 4.1.x code...
Code:
if($current_area != 'C') { uasort($all_categories, "func_categories_sort"); }
NOTE: Both of the 2 mods for the 4.1.x branch are in the same file: include/categories.php

Robert
__________________
X-cart 4.1.10
Reply With Quote