Skip to content

Commit 9c2dc10

Browse files
committed
MAGETWO-91798: Implement GroupedProduct Price indexer
1 parent 2b5ee3d commit 9c2dc10

File tree

1 file changed

+9
-1
lines changed
  • app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Indexer/Price

1 file changed

+9
-1
lines changed

app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Indexer/Price/Grouped.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace Magento\GroupedProduct\Model\ResourceModel\Product\Indexer\Price;
99

1010
use Magento\Catalog\Api\Data\ProductInterface;
11+
use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\BasePriceModifier;
1112
use Magento\Eav\Model\Config;
1213
use Magento\Framework\App\ResourceConnection;
1314
use Magento\Framework\DB\Adapter\AdapterInterface;
@@ -69,12 +70,17 @@ class Grouped implements DimensionalIndexerInterface
6970
* @var bool
7071
*/
7172
private $fullReindexAction;
73+
/**
74+
* @var BasePriceModifier
75+
*/
76+
private $basePriceModifier;
7277

7378
/**
7479
* @param IndexTableStructureFactory $indexTableStructureFactory
7580
* @param TableMaintainer $tableMaintainer
7681
* @param MetadataPool $metadataPool
7782
* @param ResourceConnection $resource
83+
* @param BasePriceModifier $basePriceModifier
7884
* @param string $connectionName
7985
* @param bool $fullReindexAction
8086
* @param array $priceModifiers
@@ -84,6 +90,7 @@ public function __construct(
8490
TableMaintainer $tableMaintainer,
8591
MetadataPool $metadataPool,
8692
ResourceConnection $resource,
93+
BasePriceModifier $basePriceModifier,
8794
$connectionName = 'indexer',
8895
$fullReindexAction = false,
8996
array $priceModifiers = []
@@ -96,6 +103,7 @@ public function __construct(
96103
$this->resource = $resource;
97104
$this->fullReindexAction = $fullReindexAction;
98105
$this->connection = $this->resource->getConnection($this->connectionName);
106+
$this->basePriceModifier = $basePriceModifier;
99107
}
100108

101109
/**
@@ -132,7 +140,7 @@ public function executeByDimension(array $dimensions, \Traversable $entityIds =
132140
'maxPriceField' => 'max_price',
133141
'tierPriceField' => 'tier_price',
134142
]);
135-
143+
$this->basePriceModifier->modifyPrice($temporaryPriceTable, iterator_to_array($entityIds));
136144
$query = $this->_prepareGroupedProductPriceDataSelect($dimensions, iterator_to_array($entityIds))
137145
->insertFromSelect($temporaryPriceTable->getTableName());
138146
$this->connection->query($query);

0 commit comments

Comments
 (0)