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
7 
11 
18 class Renderer extends \Magento\Checkout\Block\Cart\Item\Renderer
19 {
25  protected $_bundleProductConfiguration = null;
26 
41  public function __construct(
42  \Magento\Framework\View\Element\Template\Context $context,
43  \Magento\Catalog\Helper\Product\Configuration $productConfig,
44  \Magento\Checkout\Model\Session $checkoutSession,
45  \Magento\Catalog\Block\Product\ImageBuilder $imageBuilder,
46  \Magento\Framework\Url\Helper\Data $urlHelper,
47  \Magento\Framework\Message\ManagerInterface $messageManager,
49  \Magento\Framework\Module\Manager $moduleManager,
50  InterpretationStrategyInterface $messageInterpretationStrategy,
51  Configuration $bundleProductConfiguration,
52  array $data = []
53  ) {
54  $this->_bundleProductConfiguration = $bundleProductConfiguration;
55  parent::__construct(
56  $context,
57  $productConfig,
58  $checkoutSession,
60  $urlHelper,
64  $messageInterpretationStrategy,
65  $data
66  );
67  $this->_isScopePrivate = true;
68  }
69 
76  public function getOptionList()
77  {
78  return $this->_bundleProductConfiguration->getOptions($this->getItem());
79  }
80 
86  public function getMessages()
87  {
88  $messages = [];
89  $quoteItem = $this->getItem();
90 
91  // Add basic messages occuring during this page load
92  $baseMessages = $quoteItem->getMessage(false);
93  if ($baseMessages) {
94  foreach ($baseMessages as $message) {
95  $messages[] = ['text' => $message, 'type' => $quoteItem->getHasError() ? 'error' : 'notice'];
96  }
97  }
98 
99  return $messages;
100  }
101 }
$message
__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, Configuration $bundleProductConfiguration, array $data=[])
Definition: Renderer.php:41
$quoteItem
Definition: quote.php:38