From ef68020c8c2b3fdb710873d0f0fc578ac3206d99 Mon Sep 17 00:00:00 2001 From: Marcel Hauri Date: Thu, 17 May 2018 09:42:41 +0200 Subject: [PATCH 1/2] [fix] typo in method name _getCharg[e]ableOptionPrice --- .../Catalog/Model/Product/Option/Type/DefaultType.php | 6 +++--- .../Magento/Catalog/Model/Product/Option/Type/Select.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/DefaultType.php b/app/code/Magento/Catalog/Model/Product/Option/Type/DefaultType.php index 690809332de4a..34c65a27fb746 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/DefaultType.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/DefaultType.php @@ -338,7 +338,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); } /** @@ -392,14 +392,14 @@ public function getProductOptions() } /** - * Return final chargable price for option + * 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 _getChargableOptionPrice($price, $isPercent, $basePrice) + protected function _getChargeableOptionPrice($price, $isPercent, $basePrice) { if ($isPercent) { return $basePrice * $price / 100; diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/Select.php b/app/code/Magento/Catalog/Model/Product/Option/Type/Select.php index 78cce7bd76163..d14f56718d159 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/Select.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/Select.php @@ -222,7 +222,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 @@ -237,7 +237,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 From 8ea661c3e0ee551941f07f681902315fc7746b01 Mon Sep 17 00:00:00 2001 From: Marcel Hauri Date: Fri, 18 May 2018 09:23:29 +0200 Subject: [PATCH 2/2] [task] add deprecated notice to misspelled method --- .../Model/Product/Option/Type/DefaultType.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/DefaultType.php b/app/code/Magento/Catalog/Model/Product/Option/Type/DefaultType.php index 34c65a27fb746..0277581b43975 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/DefaultType.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/DefaultType.php @@ -391,6 +391,19 @@ public function getProductOptions() return []; } + /** + * @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 *