Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
CurrencyRouteRequestEvent example
public
function
load
(
Request
$request
, SalesChannelContext
$context
)
: HeaderPagelet
{
$salesChannel
=
$context
->
getSalesChannel
(
)
;
$navigationId
=
$request
->
get
(
'navigationId',
$salesChannel
->
getNavigationCategoryId
(
)
)
;
if
(
!
$navigationId
)
{
throw
RoutingException::
missingRequestParameter
(
'navigationId'
)
;
}
$languages
=
$this
->
getLanguages
(
$context
,
$request
)
;
$event
=
new
CurrencyRouteRequestEvent
(
$request
,
new
Request
(
)
,
$context
)
;
$this
->eventDispatcher->
dispatch
(
$event
)
;
$navigation
=
$this
->navigationLoader->
load
(
(string)
$navigationId
,
$context
,
$salesChannel
->
getNavigationCategoryId
(
)
,
$salesChannel
->
getNavigationCategoryDepth
(
)
)
;
$criteria
=
new
Criteria
(
)
;
$criteria
->
setTitle
(
'header::currencies'
)
;