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()]
                    );
                }
            }
Home | Imprint | This part of the site doesn't use cookies.