Skip to content
Snippets Groups Projects
Commit 33aa293e authored by marina's avatar marina
Browse files

Add price calculation improvement for product option value price

The price calculation relied on the getFinalPrice value, which if
called without the qty parameter will not consider tier prices.
This method was not updated when the price improvements have been
added around 4 years ago. See similar update that was added for
Magento\Catalog\Model\Product\Option.

Resolves: #5774
parent f1e6d1c9
Branches
No related merge requests found
......@@ -11,6 +11,7 @@ namespace Magento\Catalog\Model\Product\Option;
use Magento\Catalog\Model\Product;
use Magento\Catalog\Model\Product\Option;
use Magento\Framework\Model\AbstractModel;
use Magento\Catalog\Pricing\Price\BasePrice;
/**
* Catalog product option select type model
......@@ -223,7 +224,7 @@ class Value extends AbstractModel implements \Magento\Catalog\Api\Data\ProductCu
public function getPrice($flag = false)
{
if ($flag && $this->getPriceType() == self::TYPE_PERCENT) {
$basePrice = $this->getOption()->getProduct()->getFinalPrice();
$basePrice = $this->getOption()->getProduct()->getPriceInfo()->getPrice(BasePrice::PRICE_CODE)->getValue();
$price = $basePrice * ($this->_getData(self::KEY_PRICE) / 100);
return $price;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment