Skip to content

Commit 62050b8

Browse files
ENGCOM-1580: [fix] typo in method name _getCharg[e]ableOptionPrice #15276
- Merge Pull Request #15276 from mhauri/magento2:fix-typo-in-method-chargable - Merged commits: 1. ef68020 2. 8ea661c
2 parents 9a28908 + 8ea661c commit 62050b8

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
@@ -338,7 +338,7 @@ public function getOptionPrice($optionValue, $basePrice)
338338
{
339339
$option = $this->getOption();
340340

341-
return $this->_getChargableOptionPrice($option->getPrice(), $option->getPriceType() == 'percent', $basePrice);
341+
return $this->_getChargeableOptionPrice($option->getPrice(), $option->getPriceType() == 'percent', $basePrice);
342342
}
343343

344344
/**
@@ -392,14 +392,27 @@ public function getProductOptions()
392392
}
393393

394394
/**
395-
* Return final chargable price for option
396-
*
397395
* @param float $price Price of option
398396
* @param boolean $isPercent Price type - percent or fixed
399397
* @param float $basePrice For percent price type
400398
* @return float
399+
* @deprecated 102.0.4 typo in method name
400+
* @see _getChargeableOptionPrice
401401
*/
402402
protected function _getChargableOptionPrice($price, $isPercent, $basePrice)
403+
{
404+
return $this->_getChargeableOptionPrice($price, $isPercent, $basePrice);
405+
}
406+
407+
/**
408+
* Return final chargeable price for option
409+
*
410+
* @param float $price Price of option
411+
* @param boolean $isPercent Price type - percent or fixed
412+
* @param float $basePrice For percent price type
413+
* @return float
414+
*/
415+
protected function _getChargeableOptionPrice($price, $isPercent, $basePrice)
403416
{
404417
if ($isPercent) {
405418
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
@@ -222,7 +222,7 @@ public function getOptionPrice($optionValue, $basePrice)
222222
foreach (explode(',', $optionValue) as $value) {
223223
$_result = $option->getValueById($value);
224224
if ($_result) {
225-
$result += $this->_getChargableOptionPrice(
225+
$result += $this->_getChargeableOptionPrice(
226226
$_result->getPrice(),
227227
$_result->getPriceType() == 'percent',
228228
$basePrice
@@ -237,7 +237,7 @@ public function getOptionPrice($optionValue, $basePrice)
237237
} elseif ($this->_isSingleSelection()) {
238238
$_result = $option->getValueById($optionValue);
239239
if ($_result) {
240-
$result = $this->_getChargableOptionPrice(
240+
$result = $this->_getChargeableOptionPrice(
241241
$_result->getPrice(),
242242
$_result->getPriceType() == 'percent',
243243
$basePrice

0 commit comments

Comments
 (0)