protected function prepareConfigurator(array
$data, ProductModel
$article, Detail
$variant) { if (!
$article->
getConfiguratorSet()) { throw new CustomValidationException('A configurator set has to be defined'
);
} $availableGroups =
$article->
getConfiguratorSet()->
getGroups();
$options =
new ArrayCollection();
foreach ($data['configuratorOptions'
] as $optionData) { $availableGroup =
$this->
getAvailableGroup($availableGroups,
[ 'id' =>
$optionData['groupId'
] ?? null,
'name' =>
$optionData['group'
] ?? null,
]);
// Group is in the product configurator set configured?
if (!
$availableGroup) { continue;
} // Check if the option is available in the configured product configurator set.
$option =
$this->
getAvailableOption($availableGroup->
getOptions(),
[