getBundleOptionPrice()->getValue(); } /** * Returns max price * * @return \Magento\Framework\Pricing\Amount\AmountInterface */ public function getMaximalPrice() { if (!$this->maximalPrice) { $price = $this->getBasePrice()->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->getMaxAmount($price, $this->product); } return $this->maximalPrice; } /** * Return ProductCustomOptionRepository * * @return ProductCustomOptionRepositoryInterface * @deprecated 100.1.0 */ private function getProductOptionRepository() { if (!$this->productOptionRepository) { $this->productOptionRepository = ObjectManager::getInstance()->get( ProductCustomOptionRepositoryInterface::class ); } return $this->productOptionRepository; } /** * Returns min price * * @return \Magento\Framework\Pricing\Amount\AmountInterface */ public function getMinimalPrice() { return $this->getAmount(); } /** * Returns price amount * * @return \Magento\Framework\Pricing\Amount\AmountInterface */ public function getAmount() { if (!$this->minimalPrice) { $price = parent::getValue(); if ($this->product->getPriceType() == Price::PRICE_TYPE_FIXED) { $this->loadProductCustomOptions(); /** @var \Magento\Catalog\Pricing\Price\CustomOptionPrice $customOptionPrice */ $customOptionPrice = $this->priceInfo->getPrice(CustomOptionPrice::PRICE_CODE); $price += $customOptionPrice->getCustomOptionRange(true); } $this->minimalPrice = $this->calculator->getAmount($price, $this->product); } return $this->minimalPrice; } /** * Load product custom options * * @return void */ private function loadProductCustomOptions() { if (!$this->product->getOptions()) { $options = []; foreach ($this->getProductOptionRepository()->getProductOptions($this->product) as $option) { $option->setProduct($this->product); $options[] = $option; } $this->product->setOptions($options); } } /** * get bundle product price without any option * * @return \Magento\Framework\Pricing\Amount\AmountInterface */ public function getPriceWithoutOption() { if (!$this->priceWithoutOption) { $this->priceWithoutOption = $this->calculator->getAmountWithoutOption(parent::getValue(), $this->product); } return $this->priceWithoutOption; } /** * Returns option price * * @return \Magento\Bundle\Pricing\Price\BundleOptionPrice */ protected function getBundleOptionPrice() { if (!$this->bundleOptionPrice) { $this->bundleOptionPrice = $this->priceInfo->getPrice(BundleOptionPrice::PRICE_CODE); } return $this->bundleOptionPrice; } }