$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(),
[ 'id' =>
$optionData['optionId'
] ?? null,
'name' =>
$optionData['option'
] ?? null,
]);
if (!
$option) { if (!
$optionData['option'
]) { throw new CustomValidationException('A new configurator option requires a name'
);
} $option =
new Option();
$option->
setPosition(0
);