How to list products in stock first

Hi,

is there any code / setting how can I show products, which are on stock first and products out of stock bellow?

Thanks
tim
Hi. You would want to change the order clause for the $products_query in func_catalog.inc.php.

order by
if(p.quantity > 0, 0, 1) asc,
...
Thanks Tim for reply!

I found this in func_catalog.inc.php, but where to add this code?

$products_query = database::query($query);

    return $products_query;
  }
Perect, it works! Thanks Tim!
@megamiska don't forget to use vMod for core file modifications. Otherwise it will be replaced on the first update.
@dodo thanks for tip, done :)