Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ConfiguredPriceSelection.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
14 
19 {
23  private $calculator;
24 
28  public function __construct(
29  CalculatorInterface $calculator
30  ) {
31  $this->calculator = $calculator;
32  }
33 
41  {
42  $selectionPriceList = [];
43  foreach ($price->getOptions() as $option) {
44  $selectionPriceList = array_merge(
45  $selectionPriceList,
46  $this->createSelectionPriceList($option, $price->getProduct())
47  );
48  }
49 
50  return $selectionPriceList;
51  }
52 
60  private function createSelectionPriceList(ExtensibleDataInterface $option, Product $product): array
61  {
62  return $this->calculator->createSelectionPriceList($option, $product);
63  }
64 }
$price