8
8
namespace Magento \GroupedProduct \Model \ResourceModel \Product \Indexer \Price ;
9
9
10
10
use Magento \Catalog \Api \Data \ProductInterface ;
11
+ use Magento \Catalog \Model \ResourceModel \Product \Indexer \Price \BasePriceModifier ;
11
12
use Magento \Eav \Model \Config ;
12
13
use Magento \Framework \App \ResourceConnection ;
13
14
use Magento \Framework \DB \Adapter \AdapterInterface ;
@@ -69,12 +70,17 @@ class Grouped implements DimensionalIndexerInterface
69
70
* @var bool
70
71
*/
71
72
private $ fullReindexAction ;
73
+ /**
74
+ * @var BasePriceModifier
75
+ */
76
+ private $ basePriceModifier ;
72
77
73
78
/**
74
79
* @param IndexTableStructureFactory $indexTableStructureFactory
75
80
* @param TableMaintainer $tableMaintainer
76
81
* @param MetadataPool $metadataPool
77
82
* @param ResourceConnection $resource
83
+ * @param BasePriceModifier $basePriceModifier
78
84
* @param string $connectionName
79
85
* @param bool $fullReindexAction
80
86
* @param array $priceModifiers
@@ -84,6 +90,7 @@ public function __construct(
84
90
TableMaintainer $ tableMaintainer ,
85
91
MetadataPool $ metadataPool ,
86
92
ResourceConnection $ resource ,
93
+ BasePriceModifier $ basePriceModifier ,
87
94
$ connectionName = 'indexer ' ,
88
95
$ fullReindexAction = false ,
89
96
array $ priceModifiers = []
@@ -96,6 +103,7 @@ public function __construct(
96
103
$ this ->resource = $ resource ;
97
104
$ this ->fullReindexAction = $ fullReindexAction ;
98
105
$ this ->connection = $ this ->resource ->getConnection ($ this ->connectionName );
106
+ $ this ->basePriceModifier = $ basePriceModifier ;
99
107
}
100
108
101
109
/**
@@ -132,7 +140,7 @@ public function executeByDimension(array $dimensions, \Traversable $entityIds =
132
140
'maxPriceField ' => 'max_price ' ,
133
141
'tierPriceField ' => 'tier_price ' ,
134
142
]);
135
-
143
+ $ this -> basePriceModifier -> modifyPrice ( $ temporaryPriceTable , iterator_to_array ( $ entityIds ));
136
144
$ query = $ this ->_prepareGroupedProductPriceDataSelect ($ dimensions , iterator_to_array ($ entityIds ))
137
145
->insertFromSelect ($ temporaryPriceTable ->getTableName ());
138
146
$ this ->connection ->query ($ query );
0 commit comments