@@ -458,17 +458,17 @@ private function getBaseBundleSelectionPriceSelect(): Select
458
458
}
459
459
460
460
/**
461
- * Calculate product selections price for fixed bundles
461
+ * Apply selections price for fixed bundles
462
462
*
463
463
* @return void
464
464
* @throws \Exception
465
465
*/
466
- private function calculateFixedBundleSelectionPrice ()
466
+ private function applyFixedBundleSelectionPrice ()
467
467
{
468
468
$ connection = $ this ->getConnection ();
469
469
470
- $ selectionPriceValue = 'bs .selection_price_value ' ;
471
- $ selectionPriceType = 'bs .selection_price_type ' ;
470
+ $ selectionPriceValue = 'bsp .selection_price_value ' ;
471
+ $ selectionPriceType = 'bsp .selection_price_type ' ;
472
472
$ priceExpr = new \Zend_Db_Expr (
473
473
$ connection ->getCheckSql (
474
474
$ selectionPriceType . ' = 1 ' ,
@@ -501,7 +501,11 @@ private function calculateFixedBundleSelectionPrice()
501
501
);
502
502
503
503
$ select = $ this ->getBaseBundleSelectionPriceSelect ();
504
- $ select ->where (
504
+ $ select ->joinInner (
505
+ ['bsp ' => $ this ->getTable ('catalog_product_bundle_selection_price ' )],
506
+ 'bs.selection_id = bsp.selection_id AND bsp.website_id = i.website_id ' ,
507
+ []
508
+ )->where (
505
509
'i.price_type=? ' ,
506
510
\Magento \Bundle \Model \Product \Price::PRICE_TYPE_FIXED
507
511
)->columns (
@@ -512,11 +516,22 @@ private function calculateFixedBundleSelectionPrice()
512
516
'tier_price ' => $ tierExpr ,
513
517
]
514
518
);
515
- $ query = $ select ->insertFromSelect ($ this ->getBundleSelectionTable ());
519
+ $ query = $ select ->crossUpdateFromSelect ($ this ->getBundleSelectionTable ());
516
520
$ connection ->query ($ query );
521
+ }
517
522
518
- $ selectionPriceValue = 'bsp.selection_price_value ' ;
519
- $ selectionPriceType = 'bsp.selection_price_type ' ;
523
+ /**
524
+ * Calculate selections price for fixed bundles
525
+ *
526
+ * @return void
527
+ * @throws \Exception
528
+ */
529
+ private function calculateFixedBundleSelectionPrice ()
530
+ {
531
+ $ connection = $ this ->getConnection ();
532
+
533
+ $ selectionPriceValue = 'bs.selection_price_value ' ;
534
+ $ selectionPriceType = 'bs.selection_price_type ' ;
520
535
$ priceExpr = new \Zend_Db_Expr (
521
536
$ connection ->getCheckSql (
522
537
$ selectionPriceType . ' = 1 ' ,
@@ -549,11 +564,7 @@ private function calculateFixedBundleSelectionPrice()
549
564
);
550
565
551
566
$ select = $ this ->getBaseBundleSelectionPriceSelect ();
552
- $ select ->joinInner (
553
- ['bsp ' => $ this ->getTable ('catalog_product_bundle_selection_price ' )],
554
- 'bs.selection_id = bsp.selection_id AND bsp.website_id = i.website_id ' ,
555
- []
556
- )->where (
567
+ $ select ->where (
557
568
'i.price_type=? ' ,
558
569
\Magento \Bundle \Model \Product \Price::PRICE_TYPE_FIXED
559
570
)->columns (
@@ -564,12 +575,14 @@ private function calculateFixedBundleSelectionPrice()
564
575
'tier_price ' => $ tierExpr ,
565
576
]
566
577
);
567
- $ query = $ select ->crossUpdateFromSelect ($ this ->getBundleSelectionTable ());
578
+ $ query = $ select ->insertFromSelect ($ this ->getBundleSelectionTable ());
568
579
$ connection ->query ($ query );
580
+
581
+ $ this ->applyFixedBundleSelectionPrice ();
569
582
}
570
583
571
584
/**
572
- * Calculate product selections price for dynamic bundles
585
+ * Calculate selections price for dynamic bundles
573
586
*
574
587
* @param array $dimensions
575
588
* @return void
0 commit comments