@@ -708,13 +708,15 @@ private function calculateDynamicBundleSelectionPrice(array $dimensions): void
708
708
'IF(i.tier_percent IS NOT NULL, ROUND((1 - i.tier_percent / 100) * idx.min_price * bs.selection_qty, 4),
709
709
NULL) AS `tier_price` '
710
710
];
711
+ $ metadata = $ this ->metadataPool ->getMetadata (ProductInterface::class);
712
+ $ linkField = $ metadata ->getLinkField ();
711
713
$ selectFrom = [
712
714
'` ' . $ this ->getBundlePriceTable () . '` AS `i` ' ,
713
715
'INNER JOIN ` ' . $ this ->getTable ('catalog_product_entity ' ) .
714
716
'` AS `parent_product` ON parent_product.entity_id = i.entity_id AND
715
717
(parent_product.created_in <= 1 AND parent_product.updated_in > 1) ' ,
716
718
'INNER JOIN ` ' . $ this ->getTable ('catalog_product_bundle_option ' ) . '` AS `bo`
717
- ON bo.parent_id = parent_product.row_id ' ,
719
+ ON bo.parent_id = parent_product. ' . $ linkField ,
718
720
'INNER JOIN ` ' . $ this ->getTable ('catalog_product_bundle_selection ' ) . '` AS `bs`
719
721
ON bs.option_id = bo.option_id ' ,
720
722
'INNER JOIN ` ' . $ this ->getMainTable ($ dimensions ) . '` AS `idx` USE INDEX (PRIMARY)
@@ -738,7 +740,7 @@ private function calculateDynamicBundleSelectionPrice(array $dimensions): void
738
740
implode (" AND " , $ selectWhere )
739
741
);
740
742
$ connection ->query (sprintf (
741
- "INSERT INTO `catalog_product_index_price_bundle_sel_temp ` (%s) %s ON DUPLICATE KEY UPDATE %s " ,
743
+ "INSERT INTO ` " . $ this -> getBundleSelectionTable () . " ` (%s) %s ON DUPLICATE KEY UPDATE %s " ,
742
744
implode (", " , $ insertColumns ),
743
745
$ select ,
744
746
implode (", " , $ updateValues )
0 commit comments