Change products sorting on WHMCS Upgrade page + show product descriptions
At a time im writing this, WHMCS client area / upgrade page lists hosting packages from several groups in bad order and dont showing descriptions of these packages.

To set order according to category, then according to package id, follow this tutorial. Backup already existing files before modiffications.

create new file in:
or in:
(create file in one directory which do exist)

filename: modifier.sortby.php
file content:

PHP Code:
<?php## sorts an array of named arrays by the supplied fields
function array_sort_by_fields(&$data$sortby){      static $sort_funcs = array();         if (empty($sort_funcs[$sortby]))    {        $code "\$c=0;";        foreach (split(','$sortby) as $key)        {           $d '1';              if (substr($key01) == '-')              {                 $d '-1';                 $key substr($key1);              }              if (substr($key01) == '#')              {                 $key substr($key1);               $code .= "if ( \$a['$key'] > \$b['$key']) return $d * 1;\n";$code .= "if ( \$a['$key'] < \$b['$key']) return $d * -1;\n";              }              else              {               $code .= "if ( (\$c = strcasecmp(\$a['$key'],\$b['$key'])) != 0 ) return $d * \$c;\n";            }        }        $code .= 'return $c;';        $sort_func $sort_funcs[$sortby] = create_function('$a, $b'$code);    }    else    {        $sort_func $sort_funcs[$sortby];    }       uasort($data$sort_func);   }
## Modifier: sortby - allows arrays of named arrays to be sorted by a given field#
function smarty_modifier_sortby($arrData$sortfields) {   array_sort_by_fields($arrData$sortfields);   return $arrData;}

Then modiffy upgrade.tpl file that is located in your template folder /templates/templatename/

{foreach key=num item=upgradepackage from=$upgradepackages}

replace by:
{foreach key=num item=upgradepackage from=$upgradepackages|@sortby:"gid,pid"}

to show description:

<strong>{$upgradepackage.groupname} - {$}</strong>

<strong>{$upgradepackage.groupname} - {$}</strong>

to truncate description: