Skip to content

Commit 686cdf5

Browse files
Egor ShitikovRoman Ganin
authored andcommitted
MAGETWO-3233: Clone - Configurable product doesn't go Out of stock with FPC enabled if customer buy the last associated product
1 parent aaef3dc commit 686cdf5

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

app/code/Magento/Catalog/Helper/Product.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,13 @@ public function isDataForPriceIndexerWasChanged($data)
185185
* @param \Magento\Catalog\Model\Product $data
186186
* @return boolean
187187
*/
188-
public function isDataForProductCategoryIndexerWasChanged($data)
188+
public function isDataForProductCategoryIndexerWasChanged(\Magento\Catalog\Model\Product $data)
189189
{
190-
if ($data instanceof ModelProduct) {
191190
foreach ($this->_reindexProductCategoryIndexerData['byDataChange'] as $param) {
192191
if ($data->dataHasChangedFor($param)) {
193192
return true;
194193
}
195194
}
196-
}
197195
return false;
198196
}
199197

app/code/Magento/Catalog/Model/Category.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,7 @@ public function reindex()
10261026
}
10271027
$affectedProductIds = $this->getAffectedProductIds();
10281028
$productIndexer = $this->indexerRegistry->get(Indexer\Category\Product::INDEXER_ID);
1029-
if (!$productIndexer->isScheduled() && $affectedProductIds != null) {
1029+
if (!$productIndexer->isScheduled() && !empty($affectedProductIds)) {
10301030
$productIndexer->reindexList($this->getPathIds());
10311031
}
10321032
}

0 commit comments

Comments
 (0)