protected function getIDListChildrenCategory($iCategoryID) : array
    {
        //Get category item
        $obCategoryItem = CategoryItem::make($iCategoryID);
        if ($obCategoryItem->isEmpty() || $obCategoryItem->children->isEmpty()) {
            return [];
        }

        $arResultIDList = [];
        foreach ($obCategoryItem->children as $obChildCategoryItem) {
            $arResultIDList = array_merge($arResultIDList, (array) ProductListStore::instance()->category->get($obChildCategoryItem->id));
            $arResultIDList = array_merge($arResultIDList, $this->getIDListChildrenCategory($obChildCategoryItem->id));
        }

        return $arResultIDList;
    }
protected function getIDListChildrenCategory($iCategoryID) : array
    {
        //Get category item
        $obCategoryItem = CategoryItem::make($iCategoryID);
        if ($obCategoryItem->isEmpty() || $obCategoryItem->children->isEmpty()) {
            return [];
        }

        $arResultIDList = [];
        foreach ($obCategoryItem->children as $obChildCategoryItem) {
            $arResultIDList = array_merge($arResultIDList, (array) ProductListStore::instance()->category->get($obChildCategoryItem->id));
            $arResultIDList = array_merge($arResultIDList, $this->getIDListChildrenCategory($obChildCategoryItem->id));
        }

        return $arResultIDList;
    }
protected function getIDListChildrenCategory ( $ iCategoryID ) : array { //Get category item $ obCategoryItem = CategoryItem :: make ( $ iCategoryID ) ; if ( $ obCategoryItem -> isEmpty ( ) || $ obCategoryItem -> children -> isEmpty ( ) ) { return [ ] ; } $ arResultIDList = [ ] ; foreach ( $ obCategoryItem -> children as $ obChildCategoryItem ) { $ arResultIDList = array_merge ( $ arResultIDList , ( array ) ProductListStore :: instance ( ) -> category -> get ( $ obChildCategoryItem -> id ) ) ; $ arResultIDList = array_merge ( $ arResultIDList , $ this -> getIDListChildrenCategory ( $ obChildCategoryItem -> id ) ) ; } return $ arResultIDList ; }
Get product ID list for children categories
@param int $iCategoryID
@return array
Get product ID list for children categories