-
Notifications
You must be signed in to change notification settings - Fork 90
Add parent_sku field #84 #152
Add parent_sku field #84 #152
Conversation
|
||
$this->searchCriteriaBuilder->addFilters([$this->filterBuilder->create()]); | ||
|
||
$searchResult = $this->productRepository->getList($this->searchCriteriaBuilder->create()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea of an indexer is to work fast - we don't use repository in indexer (nor filter or search builders), mostly plain SQL.
Please use plain SQL to get SKU for product ids.
You can easily get SKU for products ids with simple SQL.. all data is available in "catalog_product_entity" table.
Please take a look e.g to Product ResourceModel
https://github.com/DivanteLtd/magento2-vsbridge-indexer/blob/develop/src/module-vsbridge-indexer-catalog/Model/ResourceModel/Product.php
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
{ | ||
$parentIds = []; | ||
|
||
foreach ($indexData as $productId => $productData) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As it's not use by default VSF yet, so exporting parent sku - should be optional.
Please add an option to configuration - so user can choose if we should export parent_sku or not - by default set it to NO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
$parentIds = []; | ||
|
||
foreach ($indexData as $productId => $productData) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove empty line after foreach
statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Thanks for your PR. |
Added parent_sku field.
e.g.
"parent_sku":["MH01","MH02"]
Added new parent_data data provider Divante\VsbridgeIndexerCatalog\Model\Indexer\DataProvider\Product\ParentData for indices.