When I would use this function VM shown one child category products only.
In administrator/components/com_virtuemart/models/product.php line 470 missing . before = mark.
right code is
$cats .= $childcat->virtuemart_category_id .',';
thanks -- Max notified