/** * Option amount calculation for bundle product * * @param float $baseValue * @return \Magento\Framework\Pricing\Amount\AmountInterface */ public function getConfiguredAmount($baseValue = 0.0) { $selectionPriceList = []; foreach ($this->getOptions() as $option) { $selectionPriceList = array_merge($selectionPriceList, $this->calculator->createSelectionPriceList($option, $this->product)); } return $this->calculator->calculateBundleAmount($baseValue, $this->product, $selectionPriceList); }
/** * Calculate maximal or minimal options value * * @param bool $searchMin * @return bool|float */ protected function calculateOptions($searchMin = true) { $priceList = []; /* @var $option \Magento\Bundle\Model\Option */ foreach ($this->getOptions() as $option) { if ($searchMin && !$option->getRequired()) { continue; } $selectionPriceList = $this->calculator->createSelectionPriceList($option, $this->product); $selectionPriceList = $this->calculator->processOptions($option, $selectionPriceList, $searchMin); $priceList = array_merge($priceList, $selectionPriceList); } $amount = $this->calculator->calculateBundleAmount(0.0, $this->product, $priceList); return $amount->getValue(); }