Log in
Helper

DefaultCategory

Magento\Catalog\Helper\DefaultCategory

What it does

This helper class provides access to Magento's default root category ID, which is hardcoded as 2.

Developers use this when they need to reference the base category that serves as the parent for all other categories in the catalog hierarchy, commonly needed in category tree operations or when initializing catalog structures.

Public Methods

  • getId()