Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
resolvePreviews example
new
ProductCollection
(
)
,
$aggregations
,
$origin
,
$context
->
getContext
(
)
)
;
}
$mapping
=
array_combine
(
$keys
,
$keys
)
;
$hasOptionFilter
=
$this
->
hasOptionFilter
(
$criteria
)
;
if
(
!
$hasOptionFilter
)
{
$mapping
=
$this
->
resolvePreviews
(
$keys
,
$context
)
;
}
$event
=
new
ProductListingResolvePreviewEvent
(
$context
,
$criteria
,
$mapping
,
$hasOptionFilter
)
;
$this
->eventDispatcher->
dispatch
(
$event
)
;
$mapping
=
$event
->
getMapping
(
)
;
$read
=
$criteria
->
cloneForRead
(
array_values
(
$mapping
)
)
;
$read
->
addAssociation
(
'options.group'
)
;
$searchResult
=
$this
->productRepository->
search
(
$read
,
$context
)
;