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 @@ -304,12 +304,16 @@ protected function _fillTemporaryTable(
304
304
305
305
/** @var $attribute \Magento\Catalog\Model\ResourceModel\Eav\Attribute */
306
306
foreach ($ columnsList as $ columnName => $ attribute ) {
307
- $ countTableName = 't ' . $ iterationNum ++;
307
+ $ countTableName = 't ' . ( $ iterationNum ++) ;
308
308
$ joinCondition = sprintf (
309
- 'e.%3$s = %1$s.%3$s AND %1$s.attribute_id = %2$d AND %1$s.store_id = 0 ' ,
309
+ 'e.%3$s = %1$s.%3$s ' .
310
+ ' AND %1$s.attribute_id = %2$d ' .
311
+ ' AND (%1$s.store_id = %4$d ' .
312
+ ' OR %1$s.store_id = 0) ' ,
310
313
$ countTableName ,
311
314
$ attribute ->getId (),
312
- $ metadata ->getLinkField ()
315
+ $ metadata ->getLinkField (),
316
+ $ storeId
313
317
);
314
318
315
319
$ select ->joinLeft (
@@ -323,9 +327,10 @@ protected function _fillTemporaryTable(
323
327
$ columnValueName = $ attributeCode . $ valueFieldSuffix ;
324
328
if (isset ($ flatColumns [$ columnValueName ])) {
325
329
$ valueJoinCondition = sprintf (
326
- 'e.%1$s = %2$s.option_id AND %2$s.store_id = 0 ' ,
330
+ 'e.%1$s = %2$s.option_id AND ( %2$s.store_id = %3$d OR %2$s.store_id = 0) ' ,
327
331
$ attributeCode ,
328
- $ countTableName
332
+ $ countTableName ,
333
+ $ storeId
329
334
);
330
335
$ selectValue ->joinLeft (
331
336
[
You can’t perform that action at this time.
0 commit comments