$sortby = 'name'; $c = $modx->newQuery('Products'); $c->sortby($sortby, 'ASC');
This question has been answered by Bruno17. See the first response.
this is something like this one, and should work the same way:Sorry Bruno, but I don't know how to translate that situation into mine. Can you help some more?
http://forums.modx.com/thread/?thread=99327
$c->sortby('CAST(SUBSTRING(name, 4) AS SIGNED)', 'ASC');
$sortby = 'CAST(SUBSTRING(name, 4) AS SIGNED)'; $c = $modx->newQuery('Products'); $c->sortby($sortby, 'ASC');