Skip to content

Commit 025dc7e

Browse files
author
Stanislav Idolov
authored
ENGCOM-1769: [Forwardport] [fix] typo in method name _getCharg[e]ableOptionPrice #15576
2 parents ea1695a + 04426b4 commit 025dc7e

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

app/code/Magento/Catalog/Model/Product/Option/Type/DefaultType.php

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ public function getOptionPrice($optionValue, $basePrice)
341341
{
342342
$option = $this->getOption();
343343

344-
return $this->_getChargableOptionPrice($option->getPrice(), $option->getPriceType() == 'percent', $basePrice);
344+
return $this->_getChargeableOptionPrice($option->getPrice(), $option->getPriceType() == 'percent', $basePrice);
345345
}
346346

347347
/**
@@ -395,14 +395,27 @@ public function getProductOptions()
395395
}
396396

397397
/**
398-
* Return final chargable price for option
399-
*
400398
* @param float $price Price of option
401399
* @param boolean $isPercent Price type - percent or fixed
402400
* @param float $basePrice For percent price type
403401
* @return float
402+
* @deprecated 102.0.4 typo in method name
403+
* @see _getChargeableOptionPrice
404404
*/
405405
protected function _getChargableOptionPrice($price, $isPercent, $basePrice)
406+
{
407+
return $this->_getChargeableOptionPrice($price, $isPercent, $basePrice);
408+
}
409+
410+
/**
411+
* Return final chargeable price for option
412+
*
413+
* @param float $price Price of option
414+
* @param boolean $isPercent Price type - percent or fixed
415+
* @param float $basePrice For percent price type
416+
* @return float
417+
*/
418+
protected function _getChargeableOptionPrice($price, $isPercent, $basePrice)
406419
{
407420
if ($isPercent) {
408421
return $basePrice * $price / 100;

app/code/Magento/Catalog/Model/Product/Option/Type/Select.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public function getOptionPrice($optionValue, $basePrice)
231231
foreach (explode(',', $optionValue) as $value) {
232232
$_result = $option->getValueById($value);
233233
if ($_result) {
234-
$result += $this->_getChargableOptionPrice(
234+
$result += $this->_getChargeableOptionPrice(
235235
$_result->getPrice(),
236236
$_result->getPriceType() == 'percent',
237237
$basePrice
@@ -246,7 +246,7 @@ public function getOptionPrice($optionValue, $basePrice)
246246
} elseif ($this->_isSingleSelection()) {
247247
$_result = $option->getValueById($optionValue);
248248
if ($_result) {
249-
$result = $this->_getChargableOptionPrice(
249+
$result = $this->_getChargeableOptionPrice(
250250
$_result->getPrice(),
251251
$_result->getPriceType() == 'percent',
252252
$basePrice

0 commit comments

Comments
 (0)