@@ -43,21 +43,21 @@ protected function addAdditionalData($product, $withTax, $subProducts, $currency
43
43
*/
44
44
protected function getMinMaxPrices (Product $ product , $ withTax , $ subProducts , $ currencyCode )
45
45
{
46
- $ product = $ this ->productloader ->create ()->load ($ product ->getId ());
47
- $ product ->setData ('website_id ' , $ product ->getStore ()->getWebsiteId ());
48
- $ minPrice = $ product ->getPriceInfo ()->getPrice ('final_price ' )->getMinimalPrice ()->getValue ();
49
- $ minOriginalPrice = $ product ->getPriceInfo ()->getPrice ('regular_price ' )->getMinimalPrice ()->getValue ();
50
- $ maxOriginalPrice = $ product ->getPriceInfo ()->getPrice ('regular_price ' )->getMaximalPrice ()->getValue ();
51
- $ max = $ product ->getPriceInfo ()->getPrice ('final_price ' )->getMaximalPrice ()->getValue ();
46
+ $ productWithPrice = $ this ->productloader ->create ()->load ($ product ->getId ());
47
+ $ productWithPrice ->setData ('website_id ' , $ product ->getStore ()->getWebsiteId ());
48
+ $ minPrice = $ productWithPrice ->getPriceInfo ()->getPrice ('final_price ' )->getMinimalPrice ()->getValue ();
49
+ $ minOriginalPrice = $ productWithPrice ->getPriceInfo ()->getPrice ('regular_price ' )->getMinimalPrice ()->getValue ();
50
+ $ maxOriginalPrice = $ productWithPrice ->getPriceInfo ()->getPrice ('regular_price ' )->getMaximalPrice ()->getValue ();
51
+ $ max = $ productWithPrice ->getPriceInfo ()->getPrice ('final_price ' )->getMaximalPrice ()->getValue ();
52
52
$ minArray = [];
53
53
$ maxArray = [];
54
54
foreach ($ this ->groups as $ group ) {
55
55
$ groupId = (int ) $ group ->getData ('customer_group_id ' );
56
- $ product ->setData ('customer_group_id ' , $ groupId );
57
- $ minPrice = $ product ->getPriceInfo ()->getPrice ('final_price ' )->getMinimalPrice ()->getValue ();
58
- $ minArray [$ groupId ] = $ product ->getPriceInfo ()->getPrice ('final_price ' )->getMinimalPrice ()->getValue ();
59
- $ maxArray [$ groupId ] = $ product ->getPriceInfo ()->getPrice ('final_price ' )->getMaximalPrice ()->getValue ();
60
- $ product ->setData ('customer_group_id ' , null );
56
+ $ productWithPrice ->setData ('customer_group_id ' , $ groupId );
57
+ $ minPrice = $ productWithPrice ->getPriceInfo ()->getPrice ('final_price ' )->getMinimalPrice ()->getValue ();
58
+ $ minArray [$ groupId ] = $ productWithPrice ->getPriceInfo ()->getPrice ('final_price ' )->getMinimalPrice ()->getValue ();
59
+ $ maxArray [$ groupId ] = $ productWithPrice ->getPriceInfo ()->getPrice ('final_price ' )->getMaximalPrice ()->getValue ();
60
+ $ productWithPrice ->setData ('customer_group_id ' , null );
61
61
}
62
62
63
63
$ minPriceArray = [];
@@ -153,4 +153,4 @@ protected function setFinalGroupPricesBundle($field, $currencyCode, $min, $max,
153
153
}
154
154
}
155
155
}
156
- }
156
+ }
0 commit comments