public static function options($type = 0)
{
$db = Factory::getDBO();
//build the list of categories
$query = 'SELECT a.title AS text, a.id AS value, a.parent_id as parentid' . ' FROM #__phocacart_categories AS a' . ' WHERE a.published = 1' . ' ORDER BY a.ordering';
$db->setQuery($query);
$items = $db->loadObjectList();
$catId = -1;
$javascript = 'class="form-control" size="1" onchange="submitform( );"';
$tree = array();
$text = '';
$tree = PhocacartCategory::CategoryTreeOption($items, $tree, 0, $text, $catId);
return $tree;
}