Hi Seyi,
is this correct?
static function getEStoreCategory($category_id=null,$search=null,$limit=null,$limitstart=null,$orderby=null,$orderbydir=null) {
if(empty($category_id) && empty($search) && empty($limit)) return self::categoryListTree();
$db = JFactory::getDBO();
$limit = (int)$limit;
$limitstart = (int)$limitstart;
if(!empty($orderbydir) && strtolower($orderbydir)!='asc' && strtolower($orderbydir!='desc')) $orderbydir = '';
$sql = 'SELECT SQL_CALC_FOUND_ROWS c.virtuemart_category_id AS id,lang.category_name AS label
FROM #__virtuemart_categories c
JOIN `#__virtuemart_categories_'.self::getVMLang().'` as lang using (`virtuemart_category_id`)
//WHERE c.published=1
WHERE 1=1
'.(!empty($category_id) ? ' AND c.virtuemart_category_id IN ('.self::scrubids($category_id).') ' : '').'
'.(!empty($search) ? ' AND lang.category_name LIKE '.$db->Quote( '%'.awolibrary::dbEscape( trim(JString::strtolower( $search ) ), true ).'%', false ).' ' : '').'
ORDER BY '.(empty($orderby) ? 'lang.category_name,c.virtuemart_category_id' : $orderby).' '.(!empty($orderbydir) ? $orderbydir : '').'
'.(!empty($limit) ? ' LIMIT '.(!empty($limitstart) ? $limitstart.',' : '').' '.(int)$limit.' ':'');
$db->setQuery($sql);
return $db->loadObjectList('id');
}
static private function categoryListTree($selectedCategories = array(), $cid = 0, $level = 0, $disabledFields=array()) {
global $option;
$cache = JFactory::getCache($option);
$cache->setCaching( 1 );
$cache->setLifeTime(version_compare( JVERSION, '1.6.0', 'ge' ) ? 300/60 : 300);
//$rtn = $cache->call( array( 'AwocouponVirtuemartHelper', 'categoryListTreeLoop' ),$selectedCategories, $cid, $level, $disabledFields );
$rtn = self::categoryListTreeLoop($selectedCategories, $cid, $level, $disabledFields);
return $rtn;
}
I did not find the c.published=1 in the categorylistTree function.
regards,
Jeroen