Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
BundleRegularPrice.php
Go to the documentation of this file.
1 <?php
8 
14 
19 {
23  protected $calculator;
24 
28  protected $maximalPrice;
29 
36  public function __construct(
37  Product $saleableItem,
38  $quantity,
41  ) {
42  parent::__construct($saleableItem, $quantity, $calculator, $priceCurrency);
43  }
44 
48  public function getAmount()
49  {
50  if (!isset($this->amount[$this->getValue()])) {
51  $price = $this->getValue();
52  if ($this->product->getPriceType() == Price::PRICE_TYPE_FIXED) {
54  $customOptionPrice = $this->priceInfo->getPrice(CustomOptionPrice::PRICE_CODE);
55  $price += $customOptionPrice->getCustomOptionRange(true, $this->getPriceCode());
56  }
57  $this->amount[$this->getValue()] = $this->calculator->getMinRegularAmount($price, $this->product);
58  }
59  return $this->amount[$this->getValue()];
60  }
61 
67  public function getMaximalPrice()
68  {
69  if (null === $this->maximalPrice) {
70  $price = $this->getValue();
71  if ($this->product->getPriceType() == Price::PRICE_TYPE_FIXED) {
73  $customOptionPrice = $this->priceInfo->getPrice(CustomOptionPrice::PRICE_CODE);
74  $price += $customOptionPrice->getCustomOptionRange(false, $this->getPriceCode());
75  }
76  $this->maximalPrice = $this->calculator->getMaxRegularAmount($price, $this->product);
77  }
78  return $this->maximalPrice;
79  }
80 
86  public function getMinimalPrice()
87  {
88  return $this->getAmount();
89  }
90 }
if( $block->displayPriceExclTax()||$block->displayBothPrices())(__('Excl. Tax')) ?>"> <?php if ($block -> displayPriceWithWeeeDetails()): ?> <span class="cart-tax-total" data-mage-init=' Magento Weee Helper Data Magento Weee Helper Data title amount
Definition: unit.phtml:68
$price
__construct(Product $saleableItem, $quantity, BundleCalculatorInterface $calculator, \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency)