Преглед изворни кода

feat(elasticsearch-plugin): Index custom product mappings for products without variants

Kevin Mattutat пре 4 година
родитељ
комит
a0b4534001
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      packages/elasticsearch-plugin/src/indexer.controller.ts

+ 3 - 3
packages/elasticsearch-plugin/src/indexer.controller.ts

@@ -875,9 +875,9 @@ export class ElasticsearchIndexerController implements OnModuleInit, OnModuleDes
             inStock: false,
             productInStock: false,
         };
-        const customMappings = Object.entries(this.options.customProductMappings);
-        for (const [name, def] of customMappings) {
-            item[name] = def.valueFn(product, [], languageCode);
+        const productCustomMappings = Object.entries(this.options.customProductMappings);
+        for (const [name, def] of productCustomMappings) {
+            item[`product-${name}`] = def.valueFn(product, [], languageCode);
         }
         return item;
     }