#[Route(path: '/store-api/navigation/{activeId}/{rootId}', name: 'store-api.navigation', methods: ['GET', 'POST'], defaults: ['_entity' => 'category'])]
public function load( string
$activeId,
string
$rootId,
Request
$request,
SalesChannelContext
$context,
Criteria
$criteria ): NavigationRouteResponse
{ $depth =
$request->query->
getInt('depth',
$request->request->
getInt('depth', 2
));
$metaInfo =
$this->
getCategoryMetaInfo($activeId,
$rootId);
$active =
$this->
getMetaInfoById($activeId,
$metaInfo);
$root =
$this->
getMetaInfoById($rootId,
$metaInfo);
// Validate the provided category is part of the sales channel
$this->
validate($activeId,
$active['path'
],
$context);
$isChild =
$this->
isChildCategory($activeId,
$active['path'
],
$rootId);
// If the provided activeId is not part of the rootId, a fallback to the rootId must be made here.