Category – Get Not Include_in_menu or Disabled

categoryce-1.9.0.1menu

On my start page I have a product slider block where I show categories. Now I would like to have a category that is not in the menu but in the slide.

Problem is that if disable the category of set include_in_menu to false I don't get the category in the slider. Here is the slider query:

    $_helper = Mage::helper('catalog/category');
    $children = $_helper->getStoreCategories(false, true, false)
        ->addAttributeToSelect('product_slider')
        ->addAttributeToFilter('product_slider', array('neq' => ''))
        ->addAttributeToFilter('path', array('like' => "1/{$rootCategoryId}/%"))
        ->addOrderField('product_slider')
        ->addOrderField('name');

How do I get a catgory with include_in_menu = false.

Best Answer

PiTheNumber you cannot get include_in_menu category using this code... try this

 $category=Mage::getModel('catalog/category')->load(Mage::app()->getStore()->getRootCategoryId());
$children = Mage::getResourceModel('catalog/category_collection)->addAttributeToSelect('url_key')
            ->addAttributeToSelect('*')
            ->addAttributeToSelect('all_children')
            ->addAttributeToFilter('is_active', 1)
            ->addIdFilter($category->getChildren())
            ->setOrder('position', Varien_Db_Select::SQL_ASC)
            ->joinUrlRewrite()
            ->load();
Related Topic