Skip to content

Commit b7a91b3

Browse files
authored
Update Config Product Price Logic
1 parent 9b9bc72 commit b7a91b3

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

Helper/Entity/Product/PriceManager/ProductWithChildren.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ protected function setFinalGroupPrices($field, $currencyCode, $min, $max, $dashe
180180
$minArray = [];
181181
foreach ($groupPriceList as $key => $value) {
182182
$minArray[$key]['price'] = $value['min'];
183-
$minArray[$key]['formatted'] = $this->getDashedPriceFormat($value['min'], $value['max'], $currencyCode);
183+
$minArray[$key]['formatted'] = $this->formattedConfigPrice($value['min'], $value['max'], $currencyCode);
184184
if ($currencyCode !== $this->baseCurrencyCode) {
185-
$minArray[$key]['formatted'] = $this->getDashedPriceFormat($value['min'], $value['max'], $currencyCode);
185+
$minArray[$key]['formatted'] = $this->formattedConfigPrice($value['min'], $value['max'], $currencyCode);
186186
}
187187
}
188188
/** @var Group $group */
@@ -208,6 +208,20 @@ protected function setFinalGroupPrices($field, $currencyCode, $min, $max, $dashe
208208
}
209209
}
210210

211+
/**
212+
* @param $min
213+
* @param $max
214+
* @param $currencyCode
215+
* @return mixed|string
216+
*/
217+
public function formattedConfigPrice($min, $max, $currencyCode) {
218+
if ($min != $max) {
219+
return $this->getDashedPriceFormat($min, $max, $currencyCode);
220+
} else {
221+
return $this->formatPrice($min, $currencyCode);
222+
}
223+
}
224+
211225
/**
212226
* @param $field
213227
* @param $currencyCode

0 commit comments

Comments
 (0)