Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setSelectedOptions example
new
ProductPageLoadedEvent
(
$page
,
$context
,
$request
)
)
;
return
$page
;
}
private
function
loadOptions
(
ProductPage
$page
)
: void
{
$options
=
new
PropertyGroupOptionCollection
(
)
;
if
(
(
$optionIds
=
$page
->
getProduct
(
)
->
getOptionIds
(
)
)
=== null
)
{
$page
->
setSelectedOptions
(
$options
)
;
return
;
}
foreach
(
$page
->
getConfiguratorSettings
(
)
as
$group
)
{
$groupOptions
=
$group
->
getOptions
(
)
;
if
(
$groupOptions
=== null
)
{
continue
;
}
foreach
(
$optionIds
as
$optionId
)
{
$groupOption
=
$groupOptions
->
get
(
$optionId
)
;