Shopware 6.7: Topbar Service Menu Missing After Upgrade
The Problem
During the Shopware upgrade from 6.5 to 6.7, the topbar service menu went missing from the header.
The theme template top-bar.html.twig was trying to access:
| 1 | page.header.serviceMenu |
However, this property was no longer populated by the Shopware core in the same way.
As a result, the service menu rendered empty.
The Solution
A Symfony event subscriber was introduced in both the parent theme HDESakura and the child theme PuctecHdeSakura.
The subscriber intercepts the header pagelet load event, fetches the service categories dynamically, and attaches them to the header pagelet as a custom extension.
The implementation requires three changes:
- Register the event subscriber.
- Implement the PHP subscriber.
- Update the template to reference the custom extension.
1. Register the Event Subscriber
Add the subscriber to services.xml:
| 1 2 3 4 | <service id="HDESakura\Subscriber\ServiceMenuHeaderSubscriber"> <argument type="service" id="Shopware\Core\Content\Category\Service\NavigationLoader"/> <tag name="kernel.event_subscriber"/> </service> |
2. Implement the PHP Subscriber
Create ServiceMenuHeaderSubscriber.php.
The subscriber listens to HeaderPageletLoadedEvent, loads the navigation tree for the Sales Channel’s configured ServiceCategoryId, and appends it to the header pagelet as a custom extension named serviceMenu.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | class ServiceMenuHeaderSubscriber implements EventSubscriberInterface { public const SERVICE_MENU_EXTENSION = 'serviceMenu'; public function __construct( private readonly NavigationLoaderInterface $navigationLoader, ) {} public static function getSubscribedEvents(): array { return [ HeaderPageletLoadedEvent::class => 'onHeaderPageletLoaded', ]; } public function onHeaderPageletLoaded(HeaderPageletLoadedEvent $event): void { $context = $event->getSalesChannelContext(); $serviceCategoryId = $context->getSalesChannel()->getServiceCategoryId(); if ($serviceCategoryId === null) { return; } $navigation = $this->navigationLoader->load( $serviceCategoryId, $context, $serviceCategoryId, 1 ); $serviceMenu = new CategoryCollection(array_map( static fn (TreeItem $treeItem) => $treeItem->getCategory(), $navigation->getTree() )); $event->getPagelet()->addExtension(self::SERVICE_MENU_EXTENSION, $serviceMenu); } } |
3. Update the Template
Update top-bar.html.twig to reference the custom pagelet extension instead of the obsolete page.header.serviceMenu property.
Before
{% for serviceMenuItem in page.header.serviceMenu %}
After
{% for serviceMenuItem in header.extensions.serviceMenu %}
The template now loops over the serviceMenu extension added to the header pagelet by the event subscriber.
Result
After applying these changes, the topbar service menu is displayed correctly again in the Shopware 6.7 theme, using the configured service categories.
Recent help desk articles
Greetings! I'm Aneesh Sreedharan, CEO of 2Hats Logic Solutions. At 2Hats Logic Solutions, we are dedicated to providing technical expertise and resolving your concerns in the world of technology. Our blog page serves as a resource where we share insights and experiences, offering valuable perspectives on your queries.

