Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
FinalPrice.php
Go to the documentation of this file.
1 <?php
8 
10 {
14  protected $priceResolver;
15 
19  protected $values = [];
20 
28  public function __construct(
29  \Magento\Framework\Pricing\SaleableInterface $saleableItem,
30  $quantity,
31  \Magento\Framework\Pricing\Adjustment\CalculatorInterface $calculator,
34  ) {
35  parent::__construct($saleableItem, $quantity, $calculator, $priceCurrency);
36  $this->priceResolver = $priceResolver;
37  }
38 
42  public function getValue()
43  {
44  if (!isset($this->values[$this->product->getId()])) {
45  $this->values[$this->product->getId()] = $this->priceResolver->resolvePrice($this->product);
46  }
47 
48  return $this->values[$this->product->getId()];
49  }
50 }
__construct(\Magento\Framework\Pricing\SaleableInterface $saleableItem, $quantity, \Magento\Framework\Pricing\Adjustment\CalculatorInterface $calculator, \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency, PriceResolverInterface $priceResolver)
Definition: FinalPrice.php:28