File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
app/code/Magento/Catalog/Model/Indexer/Product/Flat Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -289,12 +289,16 @@ protected function _fillTemporaryTable(
289
289
290
290
/** @var $attribute \Magento\Catalog\Model\ResourceModel\Eav\Attribute */
291
291
foreach ($ columnsList as $ columnName => $ attribute ) {
292
- $ countTableName = 't ' . $ iterationNum ++;
292
+ $ countTableName = 't ' . ( $ iterationNum ++) ;
293
293
$ joinCondition = sprintf (
294
- 'e.%3$s = %1$s.%3$s AND %1$s.attribute_id = %2$d AND %1$s.store_id = 0 ' ,
294
+ 'e.%3$s = %1$s.%3$s ' .
295
+ ' AND %1$s.attribute_id = %2$d ' .
296
+ ' AND (%1$s.store_id = %4$d ' .
297
+ ' OR %1$s.store_id = 0) ' ,
295
298
$ countTableName ,
296
299
$ attribute ->getId (),
297
- $ metadata ->getLinkField ()
300
+ $ metadata ->getLinkField (),
301
+ $ storeId
298
302
);
299
303
300
304
$ select ->joinLeft (
@@ -308,9 +312,10 @@ protected function _fillTemporaryTable(
308
312
$ columnValueName = $ attributeCode . $ valueFieldSuffix ;
309
313
if (isset ($ flatColumns [$ columnValueName ])) {
310
314
$ valueJoinCondition = sprintf (
311
- 'e.%1$s = %2$s.option_id AND %2$s.store_id = 0 ' ,
315
+ 'e.%1$s = %2$s.option_id AND ( %2$s.store_id = %3$d OR %2$s.store_id = 0) ' ,
312
316
$ attributeCode ,
313
- $ countTableName
317
+ $ countTableName ,
318
+ $ storeId
314
319
);
315
320
$ selectValue ->joinLeft (
316
321
[
You can’t perform that action at this time.
0 commit comments