Skip to content

Commit 8bdedc5

Browse files
author
Emipro
committed
Update Code for Price Calculation
1 parent 4d84a7a commit 8bdedc5

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

app/code/Magento/Catalog/Block/Product/View/Options.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Magento\Catalog\Block\Product\View;
1313

1414
use Magento\Catalog\Model\Product;
15+
use Magento\Catalog\Model\Product\Option\Value;
1516

1617
/**
1718
* @api
@@ -20,11 +21,6 @@
2021
*/
2122
class Options extends \Magento\Framework\View\Element\Template
2223
{
23-
/**
24-
* Option type percent
25-
*/
26-
protected static $typePercent = 'percent';
27-
2824
/**
2925
* @var Product
3026
*/
@@ -165,8 +161,10 @@ public function hasOptions()
165161
*/
166162
protected function _getPriceConfiguration($option)
167163
{
168-
$option->getPriceType() == self::$typePercent ? $optionPrice = $option->getPrice(true) :
169-
$optionPrice = $this->pricingHelper->currency($option->getPrice(true), false, false);
164+
$optionPrice = $option->getPrice(true);
165+
if($option->getPriceType() != Value::TYPE_PERCENT) {
166+
$optionPrice = $this->pricingHelper->currency($optionPrice, false, false);
167+
}
170168
$data = [
171169
'prices' => [
172170
'oldPrice' => [

0 commit comments

Comments
 (0)