Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
HeaderPageletLoadedEvent example
$page
=
new
HeaderPagelet
(
$navigation
,
$languages
,
$currencies
,
$contextLanguage
,
$context
->
getCurrency
(
)
,
$this
->
getServiceMenu
(
$context
)
)
;
$this
->eventDispatcher->
dispatch
(
new
HeaderPageletLoadedEvent
(
$page
,
$context
,
$request
)
)
;
return
$page
;
}
private
function
getServiceMenu
(
SalesChannelContext
$context
)
: CategoryCollection
{
$serviceId
=
$context
->
getSalesChannel
(
)
->
getServiceCategoryId
(
)
;
if
(
$serviceId
=== null
)
{
return
new
CategoryCollection
(
)
;
}