Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Forwardport] [fix] typo in method name _getCharg[e]ableOptionPrice #15576

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions app/code/Magento/Catalog/Model/Product/Option/Type/DefaultType.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public function getOptionPrice($optionValue, $basePrice)
{
$option = $this->getOption();

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

/**
Expand Down Expand Up @@ -395,14 +395,27 @@ public function getProductOptions()
}

/**
* Return final chargable price for option
*
* @param float $price Price of option
* @param boolean $isPercent Price type - percent or fixed
* @param float $basePrice For percent price type
* @return float
* @deprecated 102.0.4 typo in method name
* @see _getChargeableOptionPrice
*/
protected function _getChargableOptionPrice($price, $isPercent, $basePrice)
{
return $this->_getChargeableOptionPrice($price, $isPercent, $basePrice);
}

/**
* Return final chargeable price for option
*
* @param float $price Price of option
* @param boolean $isPercent Price type - percent or fixed
* @param float $basePrice For percent price type
* @return float
*/
protected function _getChargeableOptionPrice($price, $isPercent, $basePrice)
{
if ($isPercent) {
return $basePrice * $price / 100;
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Catalog/Model/Product/Option/Type/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public function getOptionPrice($optionValue, $basePrice)
foreach (explode(',', $optionValue) as $value) {
$_result = $option->getValueById($value);
if ($_result) {
$result += $this->_getChargableOptionPrice(
$result += $this->_getChargeableOptionPrice(
$_result->getPrice(),
$_result->getPriceType() == 'percent',
$basePrice
Expand All @@ -246,7 +246,7 @@ public function getOptionPrice($optionValue, $basePrice)
} elseif ($this->_isSingleSelection()) {
$_result = $option->getValueById($optionValue);
if ($_result) {
$result = $this->_getChargableOptionPrice(
$result = $this->_getChargeableOptionPrice(
$_result->getPrice(),
$_result->getPriceType() == 'percent',
$basePrice
Expand Down