View Single Post
  #20  
Old 04-01-2009, 02:58 PM
 
benz benz is offline
 

Senior Member
  
Join Date: Oct 2007
Posts: 111
 

Default Re: Subcategory Mods on 4.2.0

Apologies all, I'd forgotten that I added that flag myself ages ago.

In categories.php around line 68 you can make the following change.
(WARNING - only tested in Xcart 4.1.11)

PHP Code:
if ($current_area == "C" || $current_area == "B") {
        global 
$user_account;
        
$search_condition[] = "$sql_tbl[categories].avail='Y'";
        
$search_condition[] = "($sql_tbl[category_memberships].membershipid IS NULL OR $sql_tbl[category_memberships].membershipid = '$user_account[membershipid]')";
        if (
$flag == "all")
            
$sort_condition " ORDER BY category";
#Add this line
        
elseif ($flag == "sub_orderby")
            
$sort_condition " ORDER BY $sql_tbl[categories].order_by";
#end modification
        
else
$sort_condition " ORDER BY $sql_tbl[categories].order_by, category"

In Xcart4.1.11 you can also pass any non-null $flag string to this function call and it will do the same thing without this mod thanks to the last else clause,
eg if you call
$raj =func_get_categories_list("", true,"lorumipsum");
it still works thanks to the last else clause - the bug in the original is that it doesn't work if you leave out the flag parameter.
__________________
Version 4.1.8
Version 4.1.11
Reply With Quote