Merge pull request #6535 from devansh-webkul/issues/6463
Fixed there should not be an exception if the admin is trying to add a new variant for the configurable product #6463
This commit is contained in:
commit
8d666f784b
|
|
@ -172,9 +172,7 @@ class Configurable extends AbstractType
|
|||
$permutation[$superAttribute->id] = $variantData[$superAttribute->code];
|
||||
}
|
||||
|
||||
$variant = $this->createVariant($product, $permutation, $variantData);
|
||||
|
||||
$this->productImageRepository->upload($variant, $variantData['images'] ?? null);
|
||||
$this->createVariant($product, $permutation, $variantData);
|
||||
} else {
|
||||
if (is_numeric($index = $previousVariantIds->search($variantId))) {
|
||||
$previousVariantIds->forget($index);
|
||||
|
|
@ -293,6 +291,8 @@ class Configurable extends AbstractType
|
|||
|
||||
$this->productInventoryRepository->saveInventories($data, $variant);
|
||||
|
||||
$this->productImageRepository->upload($data, $variant, 'images');
|
||||
|
||||
return $variant;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue