/** * test for getValue */ public function testGetValue() { $price = 10; $this->basePriceMock->expects($this->once())->method('getValue')->will($this->returnValue($price)); $result = $this->model->getValue(); $this->assertEquals($price, $result); }
/** * Get price value * * @return float */ public function getValue() { if ($this->item) { $configuredOptionsAmount = $this->getConfiguredAmount()->getBaseAmount(); return parent::getValue() + $this->priceInfo->getPrice(BundleDiscountPrice::PRICE_CODE)->calculateDiscount($configuredOptionsAmount); } else { return parent::getValue(); } }
/** * 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; }
/** * @inheritdoc */ public function getValue() { return max(0, parent::getValue() + $this->getLinkPrice()); }
/** * Returns price amount * * @return \Magento\Framework\Pricing\Amount\AmountInterface */ public function getAmount() { return $this->calculator->getAmount(parent::getValue(), $this->product); }
/** * Price value of product with configured options * * @return bool|float */ public function getValue() { return $this->item ? $this->calculatePrice() : parent::getValue(); }
/** * Price value of product with configured options * * @return bool|float */ public function getValue() { return $this->item ? parent::getValue() + $this->getOptionsValue() : parent::getValue(); }