2

How can I show the subcategories in the frontend even if the parent category is disabled?

Suppose I have categories like following

Electronics
           Cell phones
                      Accessories
                      Digital Camera
           Cameras

I Cellphone category is disabled, is it possible to still show the sub categories Accessories and Digital Camera, under Electronics category?

  • show them where? How? – Marius Feb 13 '15 at 22:23
  • @Marius, in the example given above if Cellphone category is disabled,I want to display the accessories and the Digital camera under Electronics. – Mukesh Feb 16 '15 at 9:41
1

In short? No. But you could override the Mage_Catalog_Block_Navigation class, method _renderCategoryMenuItemHtml to not check for isActive.

You would have to commit out line 241-243 and probably remove the link to the category to prevent people from clicking on an inactive and non existing category. So on line 308 it should be something like this

if (category->isActive()):
   $html[] = '<a href="'.$this->getCategoryUrl($category).'"'.$linkClass.'>';
   $html[] = '<span>' . $this->escapeHtml($category->getName()) . '</span>';
   $html[] = '</a>';
else:
   $html[] = '<span>' . $this->escapeHtml($category->getName()) . '</span>';
endif;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.