Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getSeoCategory example
if
(
$product
->
getMedia
(
)
)
{
$product
->
getMedia
(
)
->
sort
(
fn
(
ProductMediaEntity
$a
, ProductMediaEntity
$b
)
=>
$a
->
getPosition
(
)
<=>
$b
->
getPosition
(
)
)
;
}
if
(
$product
->
getMedia
(
)
&&
$product
->
getCover
(
)
)
{
$product
->
setMedia
(
new
ProductMediaCollection
(
array_merge
(
[
$product
->
getCover
(
)
->
getId
(
)
=>
$product
->
getCover
(
)
]
,
$product
->
getMedia
(
)
->
getElements
(
)
)
)
)
;
}
if
(
$category
=
$product
->
getSeoCategory
(
)
)
{
$request
->request->
set
(
'navigationId',
$category
->
getId
(
)
)
;
}
$page
=
$this
->genericLoader->
load
(
$request
,
$context
)
;
$page
= ProductPage::
createFrom
(
$page
)
;
$page
->
setProduct
(
$product
)
;
$page
->
setConfiguratorSettings
(
$result
->
getConfigurator
(
)
??
new
PropertyGroupCollection
(
)
)
;
$page
->
setNavigationId
(
$product
->
getId
(
)
)
;
if
(
!Feature::
isActive
(
'v6.6.0.0'
)
)
{