/** * Returns max price * * @return \Magento\Framework\Pricing\Amount\AmountInterface */ public function getMaximalPrice() { if (null === $this->maximalPrice) { $this->maximalPrice = $this->calculator->getMaxRegularAmount($this->getValue(), $this->product); } return $this->maximalPrice; }
/** * Returns max price * * @return \Magento\Framework\Pricing\Amount\AmountInterface */ public function getMaximalPrice() { if (null === $this->maximalPrice) { $price = $this->getValue(); if ($this->product->getPriceType() == Price::PRICE_TYPE_FIXED) { /** @var \Magento\Catalog\Pricing\Price\CustomOptionPrice $customOptionPrice */ $customOptionPrice = $this->priceInfo->getPrice(CustomOptionPrice::PRICE_CODE); $price += $customOptionPrice->getCustomOptionRange(false); } $this->maximalPrice = $this->calculator->getMaxRegularAmount($price, $this->product); } return $this->maximalPrice; }