osc_has_subcategories()

osc_has_subcategories()

Let you know if there are more subcategories for the current category in the list. If subcategories are not loaded, this . Function will load them and it will prepare the pointer to the first element

Code osc_has_subcategories():


    function osc_has_subcategories() {
        $category = View::newInstance()->_current('categories');
        if ( $category == '' ) return -1;
        if ( !isset($category['categories']) ) return false;

        if ( !View::newInstance()->_exists('subcategories') ) {
            View::newInstance()->_exportVariableToView('subcategories', $category['categories']);
        }
        $ret = View::newInstance()->_next('subcategories');
        //we have to delete for next iteration
        if (!$ret) View::newInstance()->_erase('subcategories');
        

    /**
     *
     * @return boolean
     */