Skip to content

Commit

Permalink
FFWEB-3030: Handle export problem for Multi Source Inventory module
Browse files Browse the repository at this point in the history
  • Loading branch information
Rayn93 committed Apr 12, 2024
1 parent 98331c0 commit 8e7e5c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/Model/Export/Catalog/Entity/ProductVariation.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,12 @@ private function getAvailability(): bool
return $this->product->isAvailable();
}

$quantity = $this->stockItem->get($this->product->getId());
try {
$quantity = $this->stockItem->get($this->product->getId());

return $quantity->getIsInStock();
return (bool) $quantity->getIsInStock();
} catch (\Exception $e) {
return $this->product->isAvailable();
}
}
}
8 changes: 6 additions & 2 deletions src/Model/Export/Catalog/ProductType/SimpleDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,12 @@ private function getAvailability(): bool
return $this->product->isAvailable();
}

$quantity = $this->stockItem->get($this->product->getId());
try {
$quantity = $this->stockItem->get($this->product->getId());

return $quantity->getIsInStock();
return (bool) $quantity->getIsInStock();
} catch (\Exception $e) {
return $this->product->isAvailable();
}
}
}

0 comments on commit 8e7e5c2

Please sign in to comment.