Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getSimilarProducts example
'description' =>
$product
->
getManufacturer
(
)
->
getName
(
)
,
'target' => '_parent',
'link' =>
$this
->
getSupplierListingLink
(
$product
->
getManufacturer
(
)
)
,
]
;
$data
[
'sRelatedArticles'
]
=
[
]
;
foreach
(
$product
->
getRelatedProducts
(
)
as
$relatedProduct
)
{
$data
[
'sRelatedArticles'
]
[
]
=
$this
->
convertListProductStruct
(
$relatedProduct
)
;
}
$data
[
'sSimilarArticles'
]
=
[
]
;
foreach
(
$product
->
getSimilarProducts
(
)
as
$similarProduct
)
{
$data
[
'sSimilarArticles'
]
[
]
=
$this
->
convertListProductStruct
(
$similarProduct
)
;
}
$data
[
'relatedProductStreams'
]
=
[
]
;
foreach
(
$product
->
getRelatedProductStreams
(
)
as
$relatedProductStream
)
{
$data
[
'relatedProductStreams'
]
[
]
=
$this
->
convertRelatedProductStreamStruct
(
$relatedProductStream
)
;
}
return
$this
->eventManager->
filter
(
'Legacy_Struct_Converter_Convert_Product',
$data
,
[
'product' =>
$product
,
]
)
;
}