Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
isOptionValid example
foreach
(
$configurator
->
getGroups
(
)
as
$group
)
{
$group
->
setSelected
(
isset
(
$selection
[
$group
->
getId
(
)
]
)
)
;
foreach
(
$group
->
getOptions
(
)
as
$option
)
{
$option
->
setSelected
(
\
in_array
(
$option
->
getId
(
)
,
$selection
, true
)
)
;
$isOptionValid
=
$this
->
isOptionValid
(
$group
,
$option
->
getId
(
)
,
$selection
,
$availableProductOptions
)
;
$option
->
setActive
(
$isOptionValid
||
(
$onlyOneGroup
&&
isset
(
$availableProductOptions
[
$option
->
getId
(
)
]
)
)
)
;
if
(
isset
(
$media
[
$option
->
getId
(
)
]
)
)
{
$option
->
setMedia
(
$media
[
$option
->
getId
(
)
]
)
;
}
}