Skip to content

Commit

Permalink
[Forwardport] magento/magento2#:11485 do the stock check on default l…
Browse files Browse the repository at this point in the history
…evel because the stock on website level isn't updated and should be ignored
  • Loading branch information
nmalevanec committed Feb 13, 2018
1 parent fa906ed commit 4a46800
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ public function process(Select $select)
['stock' => $stockStatusTable],
sprintf('stock.product_id = %s.entity_id', BaseSelectProcessorInterface::PRODUCT_TABLE_ALIAS),
[]
)->where('stock.stock_status = ?', Stock::STOCK_IN_STOCK);
)
->where('stock.stock_status = ?', Stock::STOCK_IN_STOCK)
->where('stock.website_id = ?', 0);
}

return $select;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@ public function testProcess()
[]
)
->willReturnSelf();
$this->select->expects($this->once())

$this->select->expects($this->exactly(2))
->method('where')
->with('stock.stock_status = ?', Stock::STOCK_IN_STOCK)
->withConsecutive(
['stock.stock_status = ?', Stock::STOCK_IN_STOCK, null],
['stock.website_id = ?', 0, null]
)
->willReturnSelf();

$this->stockStatusBaseSelectProcessor->process($this->select);
Expand Down

0 comments on commit 4a46800

Please sign in to comment.