Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setCrossSellings example
return
;
}
$request
->request->
set
(
'parentId',
$product
->
getParentId
(
)
)
;
$reviews
=
$this
->productReviewLoader->
load
(
$request
,
$context
)
;
$reviews
->
setParentId
(
$product
->
getParentId
(
)
??
$product
->
getId
(
)
)
;
$page
->
setReviews
(
$reviews
)
;
$crossSellings
=
$this
->crossSellingRoute->
load
(
$product
->
getId
(
)
,
new
Request
(
)
,
$context
,
new
Criteria
(
)
)
;
$page
->
setCrossSellings
(
$crossSellings
->
getResult
(
)
)
;
}
}
if
(
$productConfig
->
isStatic
(
)
)
{
$product
=
$this
->
getSlotProduct
(
$slot
,
$result
,
$productConfig
->
getStringValue
(
)
)
;
}
if
(
$product
=== null
)
{
return
;
}
$crossSellings
=
$this
->crossSellingLoader->
load
(
$product
->
getId
(
)
,
new
Request
(
)
,
$context
,
new
Criteria
(
)
)
->
getResult
(
)
;
if
(
$crossSellings
->
count
(
)
)
{
$struct
->
setCrossSellings
(
$crossSellings
)
;
}
}
}