Skip to content

Commit d6e0fa7

Browse files
MC-19916: Attribute not showing on layered navigation if no value set for "All Store Views"
1 parent 85e39ad commit d6e0fa7

File tree

1 file changed

+7
-3
lines changed
  • app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav

1 file changed

+7
-3
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,16 @@ protected function _prepareSelectIndex($entityIds = null, $attributeId = null)
210210
$selectWithoutDefaultStore = $connection->select()->from(
211211
['wd' => $this->getTable('catalog_product_entity_int')],
212212
[
213-
$productIdField,
213+
'cpe.entity_id',
214214
'attribute_id',
215215
'store_id',
216216
'value',
217-
$productIdField
217+
'cpe.entity_id',
218218
]
219+
)->joinLeft(
220+
['cpe' => $this->getTable('catalog_product_entity')],
221+
"cpe.{$productIdField} = wd.{$productIdField}",
222+
[]
219223
)->joinLeft(
220224
['d2d' => $this->getTable('catalog_product_entity_int')],
221225
sprintf(
@@ -233,7 +237,7 @@ protected function _prepareSelectIndex($entityIds = null, $attributeId = null)
233237
->where("wd.attribute_id IN({$attrIdsFlat})")
234238
->where('wd.value IS NOT NULL')
235239
->where('wd.store_id != 0')
236-
->where("wd.{$productIdField} IN({$ids})");
240+
->where("cpe.entity_id IN({$ids})");
237241
$select->where("cpe.entity_id IN({$ids})");
238242
$selects = new UnionExpression(
239243
[$select, $selectWithoutDefaultStore],

0 commit comments

Comments
 (0)