File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
app/code/Magento/Catalog/Model/Indexer/Product/Flat Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -346,12 +346,20 @@ protected function _updateTemporaryTableByStoreValues(
346
346
}
347
347
348
348
//Update not simple attributes (eg. dropdown)
349
- if (isset ($ flatColumns [$ attributeCode . $ valueFieldSuffix ])) {
350
- $ select = $ this ->_connection ->select ()->joinInner (
351
- ['t ' => $ this ->_productIndexerHelper ->getTable ('eav_attribute_option_value ' )],
352
- 't.option_id = et. ' . $ attributeCode . ' AND t.store_id= ' . $ storeId ,
353
- [$ attributeCode . $ valueFieldSuffix => 't.value ' ]
354
- );
349
+ $ columnName = $ attributeCode . $ valueFieldSuffix ;
350
+ if (isset ($ flatColumns [$ columnName ])) {
351
+ $ select = $ this ->_connection ->select ();
352
+ $ select ->joinLeft (
353
+ ['t0 ' => $ this ->_productIndexerHelper ->getTable ('eav_attribute_option_value ' )],
354
+ 't0.option_id = et. ' . $ attributeCode . ' AND t0.store_id = 0 ' ,
355
+ []
356
+ )->joinLeft (
357
+ ['ts ' => $ this ->_productIndexerHelper ->getTable ('eav_attribute_option_value ' )],
358
+ 'ts.option_id = et. ' . $ attributeCode . ' AND ts.store_id = ' . $ storeId ,
359
+ []
360
+ )->columns (
361
+ [$ columnName => $ this ->_connection ->getIfNullSql ('ts.value ' , 't0.value ' )]
362
+ )->where ($ columnName . ' IS NOT NULL ' );
355
363
if (!empty ($ changedIds )) {
356
364
$ select ->where ($ this ->_connection ->quoteInto ('et.entity_id IN (?) ' , $ changedIds ));
357
365
}
You can’t perform that action at this time.
0 commit comments