Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Renderer.php
Go to the documentation of this file.
1 <?php
13 
16 
21 class Renderer extends \Magento\Checkout\Block\Cart\Item\Renderer
22 {
29 
44  public function __construct(
45  \Magento\Framework\View\Element\Template\Context $context,
46  \Magento\Catalog\Helper\Product\Configuration $productConfig,
47  \Magento\Checkout\Model\Session $checkoutSession,
48  \Magento\Catalog\Block\Product\ImageBuilder $imageBuilder,
49  \Magento\Framework\Url\Helper\Data $urlHelper,
50  \Magento\Framework\Message\ManagerInterface $messageManager,
52  \Magento\Framework\Module\Manager $moduleManager,
53  InterpretationStrategyInterface $messageInterpretationStrategy,
54  \Magento\Downloadable\Helper\Catalog\Product\Configuration $downloadableProductConfiguration,
55  array $data = []
56  ) {
57  $this->_downloadableProductConfiguration = $downloadableProductConfiguration;
58  parent::__construct(
59  $context,
60  $productConfig,
61  $checkoutSession,
63  $urlHelper,
67  $messageInterpretationStrategy,
68  $data
69  );
70  }
71 
77  public function getLinks()
78  {
79  if (!$this->getItem()) {
80  return [];
81  }
82  return $this->_downloadableProductConfiguration->getLinks($this->getItem());
83  }
84 
90  public function getLinksTitle()
91  {
92  return $this->_downloadableProductConfiguration->getLinksTitle($this->getProduct());
93  }
94 
100  public function getOptionList()
101  {
102  return $this->_downloadableProductConfiguration->getOptions($this->getItem());
103  }
104 
110  public function getOption($item)
111  {
112  return $this->_downloadableProductConfiguration->getOptions($item);
113  }
114 }
__construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Catalog\Helper\Product\Configuration $productConfig, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Catalog\Block\Product\ImageBuilder $imageBuilder, \Magento\Framework\Url\Helper\Data $urlHelper, \Magento\Framework\Message\ManagerInterface $messageManager, PriceCurrencyInterface $priceCurrency, \Magento\Framework\Module\Manager $moduleManager, InterpretationStrategyInterface $messageInterpretationStrategy, \Magento\Downloadable\Helper\Catalog\Product\Configuration $downloadableProductConfiguration, array $data=[])
Definition: Renderer.php:44