![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/cartforge.co/vendor/magento/module-catalog/Pricing/Price/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\Catalog\Pricing\Price; use Magento\Catalog\Model\Product; use Magento\Framework\Api\ExtensibleDataInterface; use Magento\Framework\Pricing\Adjustment\CalculatorInterface; use Magento\Catalog\Pricing\Price\ConfiguredPriceInterface; /** * Configured price selection model */ class ConfiguredPriceSelection { /** * @var CalculatorInterface */ private $calculator; /** * @param CalculatorInterface $calculator */ public function __construct( CalculatorInterface $calculator ) { $this->calculator = $calculator; } /** * Get Selection pricing list. * * @param ConfiguredPriceInterface $price * @return array */ public function getSelectionPriceList(ConfiguredPriceInterface $price): array { $selectionPriceList = []; foreach ($price->getOptions() as $option) { $selectionPriceList = array_merge( $selectionPriceList, $this->createSelectionPriceList($option, $price->getProduct()) ); } return $selectionPriceList; } /** * Create Selection Price List. * * @param ExtensibleDataInterface $option * @param Product $product * @return array */ private function createSelectionPriceList(ExtensibleDataInterface $option, Product $product): array { return $this->calculator->createSelectionPriceList($option, $product); } }