Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getArticleSimilar example
if
(
$product
=== null
)
{
throw
new
NotFoundException
(
sprintf
(
'Product by id "%d" not found',
$id
)
)
;
}
if
(
$this
->
getResultMode
(
)
=== self::HYDRATE_ARRAY
)
{
$product
[
'images'
]
=
$this
->
getArticleImages
(
$id
)
;
$product
[
'configuratorSet'
]
=
$this
->
getArticleConfiguratorSet
(
$id
)
;
$product
[
'links'
]
=
$this
->
getArticleLinks
(
$id
)
;
$product
[
'downloads'
]
=
$this
->
getArticleDownloads
(
$id
)
;
$product
[
'categories'
]
=
$this
->
getArticleCategories
(
$id
)
;
$product
[
'similar'
]
=
$this
->
getArticleSimilar
(
$id
)
;
$product
[
'related'
]
=
$this
->
getArticleRelated
(
$id
)
;
$product
[
'details'
]
=
$this
->
getArticleVariants
(
$id
)
;
$product
[
'seoCategories'
]
=
$this
->
getArticleSeoCategories
(
$id
)
;
if
(
isset
(
$options
[
'considerTaxInput'
]
)
&&
$options
[
'considerTaxInput'
]
)
{
$product
[
'mainDetail'
]
[
'prices'
]
=
$this
->
getTaxPrices
(
$product
[
'mainDetail'
]
[
'prices'
]
,
$product
[
'tax'
]
[
'tax'
]
)
;
foreach
(
$product
[
'details'
]
as
&
$detail
)
{