/** * Function to return the product ids of all child items of product $pid * * @param int $pid The ID of the parent product * @return array $list */ function get_child_product_ids($pid) { $db = new ps_DB; $q = "SELECT product_id FROM #__{vm}_product "; $q .= "WHERE product_parent_id='$pid' "; $db->setQuery($q); $db->query(); $i = 0; $list = Array(); while($db->next_record()) { $list[$i] = $db->f("product_id"); $i++; } return $list; }