View Single Post
  #29  
Old 07-13-2009, 09:23 AM
  pairodimes's Avatar 
pairodimes pairodimes is offline
 

Advanced Member
  
Join Date: Dec 2007
Posts: 50
 

Default Re: Subcategory Mods on 4.2.0

Quote:
Originally Posted by artmatt
Not far off for 4.2.0. I've just come to need this mod again, and I needed the sorting to work so took a look into it.

As benz says in the first bit of code I posted change
Code:
$a =func_get_categories_list("", true, "all");

to
Code:
$a =func_get_categories_list("", true, "sub_orderby");

Then you need to add the bit from benz's last post but it's not on line 68 of categories.php anymore it's now on line 533ish of /include/func/func.category.php

Add the two lines of code and it seems to work perfectly.

Hope this helps someone

I tried this method - found the line in the /include/func/func.category.php - patched it - but the categories still show up in the wrong order once we get to the Sub category level. Its weird how it shows up in the correct order when we are on the Parent Category (which dsiplays the subcategory list). Any corrolation?

Also - another question - is it possible to Not Show the <UL> for Categories that do NOT HAVE Sub categories.

The way the code is written - It runs a loop on all Categories - then runs an IF - the Category has a parent ID of the same number - then display the Sub Category list.

But I wish I could run a loop that only displayed Categories that had a ParentID of '0' (root) then ran an IF - the Category has a parent ID of the same number - then display the Sub Category list.

The reason is - this is creating unncessary UL tags and shifting my css design. Anybody know how to do this?

Is there any way to run an IF statement on the $allcategories array to check if it returns Nothing (null - no value)? Then print the UL only if the value was NOT Null?
__________________
------
Brian

Portland web design / development
X-Cart 4.1.9 (a few carts)
X-Cart 4.2.0 (1 cart so far)
Reply With Quote