$query = "SELECT .... . ' WHERE ' . $where . ' and p.published=1 and b.virtuemart_category_id>1 ' . ' ORDER BY ' . $order;
... b.virtuemart_category_id>0