Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
SuggestPageLoadedEvent example
$criteria
->
setLimit
(
10
)
;
$criteria
->
setTotalCountMode
(
Criteria::TOTAL_COUNT_MODE_EXACT
)
;
$page
->
setSearchResult
(
$this
->productSuggestRoute
->
load
(
$request
,
$salesChannelContext
,
$criteria
)
->
getListingResult
(
)
)
;
$page
->
setSearchTerm
(
(string)
$request
->query->
get
(
'search'
)
)
;
$this
->eventDispatcher->
dispatch
(
new
SuggestPageLoadedEvent
(
$page
,
$salesChannelContext
,
$request
)
)
;
return
$page
;
}
}