Skip to content

Commit 0dbcab7

Browse files
committed
MAGETWO-44584: Error "The stock item for Product in option is not valid." when adding configurable product on second website
1 parent fd7abdf commit 0dbcab7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/code/Magento/CatalogInventory/Model/StockRegistryProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function getStockItem($productId, $websiteId)
148148
if (!isset($this->stockItems[$key])) {
149149
$criteria = $this->stockItemCriteriaFactory->create();
150150
$criteria->setProductsFilter($productId);
151-
$criteria->setWebsiteFilter($websiteId);
151+
//$criteria->setWebsiteFilter($websiteId);
152152
$collection = $this->stockItemRepository->getList($criteria);
153153
$stockItem = current($collection->getItems());
154154
if ($stockItem && $stockItem->getItemId()) {

app/code/Magento/CatalogInventory/Test/Unit/Model/Spi/StockRegistryProviderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public function testGetStock()
253253
public function testGetStockItem()
254254
{
255255
$this->stockItemCriteriaFactory->expects($this->once())->method('create')->willReturn($this->stockItemCriteria);
256-
$this->stockItemCriteria->expects($this->once())->method('setWebsiteFilter')->willReturn(null);
256+
//$this->stockItemCriteria->expects($this->once())->method('setWebsiteFilter')->willReturn(null);
257257
$this->stockItemCriteria->expects($this->once())->method('setProductsFilter')->willReturn(null);
258258
$stockItemCollection = $this->getMock(
259259
'\Magento\CatalogInventory\Model\ResourceModel\Stock\Item\Collection',

0 commit comments

Comments
 (0)