Skip to content

Commit

Permalink
fix inversed logic for adding stock status for configurable product s…
Browse files Browse the repository at this point in the history
…ubitems

* the current logic is inversed as it will add the filter for stock only elements when the option is activated
* this commit fixes magento#16069
  • Loading branch information
rosenberger-e-conomix committed Nov 15, 2018
1 parent e6fee77 commit f25080b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct(
*/
public function process(Select $select)
{
if ($this->stockConfig->isShowOutOfStock()) {
if (!$this->stockConfig->isShowOutOfStock()) {
$select->joinInner(
['stock' => $this->stockStatusResource->getMainTable()],
sprintf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function testProcess($isShowOutOfStock)
->disableOriginalConstructor()
->getMock();

if ($isShowOutOfStock) {
if (!$isShowOutOfStock) {
$selectMock->expects($this->once())
->method('joinInner')
->with(
Expand Down

0 comments on commit f25080b

Please sign in to comment.