Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
BundleOptionRegularPrice.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
14 
19 {
23  const PRICE_CODE = 'bundle_option_regular_price';
24 
28  protected $calculator;
29 
33  private $bundleOptions;
34 
42  public function __construct(
43  Product $saleableItem,
44  $quantity,
47  BundleOptions $bundleOptions
48  ) {
49  parent::__construct($saleableItem, $quantity, $calculator, $priceCurrency);
50  $this->product->setQty($this->quantity);
51  $this->bundleOptions = $bundleOptions;
52  }
53 
57  public function getValue()
58  {
59  if (null === $this->value) {
60  $this->value = $this->bundleOptions->calculateOptions($this->product);
61  }
62 
63  return $this->value;
64  }
65 
71  public function getOptions() : \Magento\Bundle\Model\ResourceModel\Option\Collection
72  {
73  return $this->bundleOptions->getOptions($this->product);
74  }
75 
82  public function getOptionSelectionAmount($selection) : \Magento\Framework\Pricing\Amount\AmountInterface
83  {
84  return $this->bundleOptions->getOptionSelectionAmount(
85  $this->product,
86  $selection,
87  true
88  );
89  }
90 
96  public function getAmount() : \Magento\Framework\Pricing\Amount\AmountInterface
97  {
98  return $this->calculator->getOptionsAmount($this->product);
99  }
100 }
$block setTitle( 'CMS Block Title') -> setIdentifier('fixture_block') ->setContent('< h1 >Fixture Block Title</h1 >< a href=" store url</a><p> Config value
Definition: block.php:9
__construct(Product $saleableItem, $quantity, BundleCalculatorInterface $calculator, PriceCurrencyInterface $priceCurrency, BundleOptions $bundleOptions)