Skip to content

Commit

Permalink
Merge pull request #493 from bakaphp/variant-status-product-fix
Browse files Browse the repository at this point in the history
Variant Status Fix
  • Loading branch information
arfenis authored Aug 8, 2023
2 parents d5e4128 + 4e428dd commit 275cced
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Inventory/Variants/Services/VariantService.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ public static function createVariantsFromArray(Products $product, array $variant
if (isset($variant['attributes'])) {
$variantModel->addAttributes($user, $variant['attributes']);
}
if (isset($variant['status_id'])) {
$status = StatusRepository::getById($variant['status_id'], $variantDto->product->company()->get()->first());
$variant->setStatus($status);

if (isset($variant['status']['id'])) {
$status = StatusRepository::getById((int) $variant['status']['id'], $variantDto->product->company()->get()->first());
$variantModel->setStatus($status);
}

WarehouseRepository::getById($variantDto->warehouse_id, $variantDto->product->company()->get()->first());
Expand Down

0 comments on commit 275cced

Please sign in to comment.