Skip to content

Commit

Permalink
Update Code for Price Calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Emipro authored and Amol Chaudhari committed Feb 15, 2019
1 parent ee8402f commit 5c073d9
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions app/code/Magento/Catalog/Block/Product/View/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Magento\Catalog\Block\Product\View;

use Magento\Catalog\Model\Product;
use Magento\Catalog\Model\Product\Option\Value;

/**
* @api
Expand All @@ -20,11 +21,6 @@
*/
class Options extends \Magento\Framework\View\Element\Template
{
/**
* Option type percent
*/
protected static $typePercent = 'percent';

/**
* @var Product
*/
Expand Down Expand Up @@ -165,8 +161,10 @@ public function hasOptions()
*/
protected function _getPriceConfiguration($option)
{
$option->getPriceType() == self::$typePercent ? $optionPrice = $option->getPrice(true) :
$optionPrice = $this->pricingHelper->currency($option->getPrice(true), false, false);
$optionPrice = $option->getPrice(true);
if($option->getPriceType() != Value::TYPE_PERCENT) {
$optionPrice = $this->pricingHelper->currency($optionPrice, false, false);
}
$data = [
'prices' => [
'oldPrice' => [
Expand Down

0 comments on commit 5c073d9

Please sign in to comment.