// If the variant was found over the number, update the existing
if ($variant) { $variant =
$this->
getVariantResource()->
internalUpdate( $variant->
getId(),
$variantData,
$article );
} else { // Otherwise, the number passed to use as order number for the new variant
$variant =
$this->
getVariantResource()->
internalCreate($variantData,
$article);
} } if (!
empty($variantData['isMain'
]) || !
empty($variantData['standard'
])) { $newMain =
$variant;
$newMain->
setKind(1
);
$oldMainId =
$article->
getMainDetail()->
getId();
// Check for old main articles:
// If old main article has configurator options, use it as a usual variant
// if the old main article does not have any configurator options, delete it