31 private $salableResolver;
36 private $minimalPriceCalculator;
58 $this->minimalPriceCalculator = $minimalPriceCalculator
67 if (!$this->salableResolver->isSalable($this->getSaleableItem())) {
73 if ($this->isMsrpPriceApplicable()) {
75 $msrpBlock = $this->rendererPool->createPriceRender(
76 MsrpPrice::PRICE_CODE,
80 'zone' => $this->getZone(),
94 protected function isMsrpPriceApplicable()
98 $msrpPriceType = $this->
getSaleableItem()->getPriceInfo()->getPrice(
'msrp_price');
99 }
catch (\InvalidArgumentException $e) {
100 $this->_logger->critical($e);
105 return $msrpPriceType->canApplyMsrp(
$product) && $msrpPriceType->isMinimalPriceLessMsrp(
$product);
116 return '<div class="price-box ' . $this->
getData(
'css_classes') .
'" ' .
117 'data-role="priceBox" ' .
119 'data-price-box="product-id-' . $this->
getSaleableItem()->getId() .
'"' .
120 '>' . $html .
'</div>';
140 'display_label' =>
__(
'As low as'),
142 'include_container' =>
false,
143 'skip_adjustments' =>
true 155 $displayRegularPrice = $this->
getPriceType(
Price\RegularPrice::PRICE_CODE)->getAmount()->getValue();
156 $displayFinalPrice = $this->
getPriceType(
Price\FinalPrice::PRICE_CODE)->getAmount()->getValue();
157 return $displayFinalPrice < $displayRegularPrice;
165 public function showMinimalPrice()
167 $minTierPrice = $this->minimalPriceCalculator->getValue($this->
getSaleableItem());
171 $finalPriceValue = $finalPrice->getAmount()->getValue();
173 return $this->getDisplayMinimalPrice()
174 && $minTierPrice !==
null 175 && $minTierPrice < $finalPriceValue;
185 return parent::getCacheKey() . ($this->
getData(
'list_category_page') ?
'-list-category-page':
'');
195 $cacheKeys = parent::getCacheKeyInfo();
196 $cacheKeys[
'display_minimal_price'] = $this->getDisplayMinimalPrice();
209 $isProductList = $this->
getData(
'is_product_list');
210 return $isProductList ===
true;
getData($key='', $index=null)
getPriceId($defaultPrefix=null, $defaultSuffix=null)
__construct(Context $context, SaleableInterface $saleableItem, PriceInterface $price, RendererPool $rendererPool, array $data=[], SalableResolverInterface $salableResolver=null, MinimalPriceCalculatorInterface $minimalPriceCalculator=null)
renderAmount(AmountInterface $amount, array $arguments=[])