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 
12 use Magento\Weee\Block\Item\Price\Renderer as ItemPriceRenderer;
13 
21 {
25  protected $itemPriceRenderer;
26 
34  public function __construct(
35  \Magento\Backend\Block\Template\Context $context,
36  \Magento\Sales\Block\Adminhtml\Items\Column\DefaultColumn $defaultColumnRenderer,
37  \Magento\Tax\Helper\Data $taxHelper,
38  ItemPriceRenderer $itemPriceRenderer,
39  array $data = []
40  ) {
41  parent::__construct(
42  $context,
44  $taxHelper,
46  $data
47  );
48  }
49 
55  public function displayPriceWithWeeeDetails()
56  {
57  return $this->itemPriceRenderer->displayPriceWithWeeeDetails();
58  }
59 
65  public function displayFinalPrice()
66  {
67  return $this->itemPriceRenderer->displayFinalPrice();
68  }
69 
75  public function getUnitPriceExclTaxHtml()
76  {
77  $baseUnitPriceExclTax = $this->itemPriceRenderer->getBaseUnitDisplayPriceExclTax();
78  $unitPriceExclTax = $this->itemPriceRenderer->getUnitDisplayPriceExclTax();
79  return $this->displayPrices($baseUnitPriceExclTax, $unitPriceExclTax);
80  }
81 
87  public function getRowPriceExclTaxHtml()
88  {
89  $baseRowPriceExclTax = $this->itemPriceRenderer->getBaseRowDisplayPriceExclTax();
90  $rowPriceExclTax = $this->itemPriceRenderer->getRowDisplayPriceExclTax();
91  return $this->displayPrices($baseRowPriceExclTax, $rowPriceExclTax);
92  }
93 
99  public function getUnitPriceInclTaxHtml()
100  {
101  $baseUnitPriceInclTax = $this->itemPriceRenderer->getBaseUnitDisplayPriceInclTax();
102  $unitPriceInclTax = $this->itemPriceRenderer->getUnitDisplayPriceInclTax();
103  return $this->displayPrices($baseUnitPriceInclTax, $unitPriceInclTax);
104  }
105 
111  public function getRowPriceInclTaxHtml()
112  {
113  $baseRowPriceInclTax = $this->itemPriceRenderer->getBaseRowDisplayPriceInclTax();
114  $rowPriceInclTax = $this->itemPriceRenderer->getRowDisplayPriceInclTax();
115  return $this->displayPrices($baseRowPriceInclTax, $rowPriceInclTax);
116  }
117 
124  {
125  $baseUnitPriceExclTax = $this->itemPriceRenderer->getBaseFinalUnitDisplayPriceExclTax();
126  $unitPriceExclTax = $this->itemPriceRenderer->getFinalUnitDisplayPriceExclTax();
127  return $this->displayPrices($baseUnitPriceExclTax, $unitPriceExclTax);
128  }
129 
135  public function getFinalRowPriceExclTaxHtml()
136  {
137  $baseRowPriceExclTax = $this->itemPriceRenderer->getBaseFinalRowDisplayPriceExclTax();
138  $rowPriceExclTax = $this->itemPriceRenderer->getFinalRowDisplayPriceExclTax();
139  return $this->displayPrices($baseRowPriceExclTax, $rowPriceExclTax);
140  }
141 
148  {
149  $baseUnitPriceInclTax = $this->itemPriceRenderer->getBaseFinalUnitDisplayPriceInclTax();
150  $unitPriceInclTax = $this->itemPriceRenderer->getFinalUnitDisplayPriceInclTax();
151  return $this->displayPrices($baseUnitPriceInclTax, $unitPriceInclTax);
152  }
153 
159  public function getFinalRowPriceInclTaxHtml()
160  {
161  $baseRowPriceInclTax = $this->itemPriceRenderer->getBaseFinalRowDisplayPriceInclTax();
162  $rowPriceInclTax = $this->itemPriceRenderer->getFinalRowDisplayPriceInclTax();
163  return $this->displayPrices($baseRowPriceInclTax, $rowPriceInclTax);
164  }
165 
172  public function getTotalAmount($item)
173  {
174  return $this->itemPriceRenderer->getTotalAmount($item);
175  }
176 
183  public function getBaseTotalAmount($item)
184  {
185  return $this->itemPriceRenderer->getBaseTotalAmount($item);
186  }
187 }
__construct(\Magento\Backend\Block\Template\Context $context, \Magento\Sales\Block\Adminhtml\Items\Column\DefaultColumn $defaultColumnRenderer, \Magento\Tax\Helper\Data $taxHelper, ItemPriceRenderer $itemPriceRenderer, array $data=[])
Definition: Renderer.php:34
displayPrices($basePrice, $displayPrice)
Definition: Renderer.php:160