Skip to content

Commit

Permalink
#21747 Fix catalog_product_flat_data attribute value for store during…
Browse files Browse the repository at this point in the history
… indexer
  • Loading branch information
Bravarg authored and mahesh-rajawat committed May 2, 2019
1 parent 1cc6e75 commit 020f970
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,11 @@ protected function _fillTemporaryTable(
foreach ($columnsList as $columnName => $attribute) {
$countTableName = 't' . $iterationNum++;
$joinCondition = sprintf(
'e.%3$s = %1$s.%3$s AND %1$s.attribute_id = %2$d AND %1$s.store_id = 0',
'e.%3$s = %1$s.%3$s AND %1$s.attribute_id = %2$d AND (%1$s.store_id = %4$d OR %1$s.store_id = 0)',
$countTableName,
$attribute->getId(),
$metadata->getLinkField()
$metadata->getLinkField(),
$storeId
);

$select->joinLeft(
Expand All @@ -308,9 +309,10 @@ protected function _fillTemporaryTable(
$columnValueName = $attributeCode . $valueFieldSuffix;
if (isset($flatColumns[$columnValueName])) {
$valueJoinCondition = sprintf(
'e.%1$s = %2$s.option_id AND %2$s.store_id = 0',
'e.%1$s = %2$s.option_id AND (%2$s.store_id = %3$d OR %2$s.store_id = 0)',
$attributeCode,
$countTableName
$countTableName,
$storeId
);
$selectValue->joinLeft(
[
Expand Down

0 comments on commit 020f970

Please sign in to comment.