Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
SalutationRouteRequestEvent example
$page
->
setSalutations
(
$this
->
getSalutations
(
$salesChannelContext
,
$request
)
)
;
$this
->eventDispatcher->
dispatch
(
new
AccountProfilePageLoadedEvent
(
$page
,
$salesChannelContext
,
$request
)
)
;
return
$page
;
}
private
function
getSalutations
(
SalesChannelContext
$context
, Request
$request
)
: SalutationCollection
{
$event
=
new
SalutationRouteRequestEvent
(
$request
,
new
Request
(
)
,
$context
,
new
Criteria
(
)
)
;
$this
->eventDispatcher->
dispatch
(
$event
)
;
$salutations
=
$this
->salutationRoute
->
load
(
$event
->
getStoreApiRequest
(
)
,
$context
,
$event
->
getCriteria
(
)
)
->
getSalutations
(
)
;
return
$this
->salutationsSorter->
sort
(
$salutations
)
;
}
}