Skip to content

Commit 7442aec

Browse files
committed
MC-35016: Out of stock products doesn't filter properly using "price" filter
1 parent ae7bdbf commit 7442aec

File tree

1 file changed

+6
-1
lines changed
  • dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/ResourceModel/Product/Indexer/Price

1 file changed

+6
-1
lines changed

dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/ResourceModel/Product/Indexer/Price/ConfigurableTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public function testReindexWithCorrectPriority()
155155
true
156156
);
157157

158-
$configurableProduct = $this->getConfigurableProductFromCollection($configurableProduct->getId());
158+
$configurableProduct = $this->getConfigurableProductFromCollection((int)$configurableProduct->getId());
159159
$this->assertEquals($childProduct1->getPrice(), $configurableProduct->getMinimalPrice());
160160
}
161161

@@ -184,6 +184,11 @@ public function testReindexIfAllChildrenIsOutOfStock(): void
184184
$stockItem->setIsInStock(Stock::STOCK_OUT_OF_STOCK);
185185
$this->stockRepository->save($stockItem);
186186

187+
$configurableProduct1 = $this->productRepository->getById(1, false, null, true);
188+
$stockItem = $configurableProduct1->getExtensionAttributes()->getStockItem();
189+
$stockItem->setIsInStock(Stock::STOCK_OUT_OF_STOCK);
190+
$this->stockRepository->save($stockItem);
191+
187192
$priceIndexerProcessor = Bootstrap::getObjectManager()->get(PriceIndexerProcessor::class);
188193
$priceIndexerProcessor->reindexList(
189194
[$configurableProduct->getId(), $childProduct1->getId(), $childProduct2->getId()],

0 commit comments

Comments
 (0)