defaultColumnRenderer = $defaultColumnRenderer; $this->itemPriceRenderer = $itemPriceRenderer; $this->itemPriceRenderer->setZone('sales'); parent::__construct($context, $data); } /** * Set item * * @param Item|QuoteItem|InvoiceItem|CreditmemoItem $item * @return $this */ public function setItem($item) { $this->itemPriceRenderer->setItem($item); $this->defaultColumnRenderer->setItem($item); $this->item = $item; return $this; } /** * Return order item or quote item * * @return Item|QuoteItem */ public function getItem() { return $this->item; } /** * Return whether display setting is to display price including tax * * @return bool */ public function displayPriceInclTax() { return $this->itemPriceRenderer->displayPriceInclTax(); } /** * Return whether display setting is to display price excluding tax * * @return bool */ public function displayPriceExclTax() { return $this->itemPriceRenderer->displayPriceExclTax(); } /** * Return whether display setting is to display both price including tax and price excluding tax * * @return bool */ public function displayBothPrices() { return $this->itemPriceRenderer->displayBothPrices(); } /** * Calculate total amount for the item * * @param Item|QuoteItem|InvoiceItem|CreditmemoItem $item * @return mixed */ public function getTotalAmount($item) { return $this->itemPriceRenderer->getTotalAmount($item); } /** * Calculate base total amount for the item * * @param Item|QuoteItem|InvoiceItem|CreditmemoItem $item * @return mixed */ public function getBaseTotalAmount($item) { return $this->itemPriceRenderer->getBaseTotalAmount($item); } /** * Retrieve formatted price, use different formatter depending on type of item * * @param float $price * @return string */ public function formatPrice($price) { return $this->itemPriceRenderer->formatPrice($price); } /** * Return html that contains both base price and display price * * @param float $basePrice * @param float $displayPrice * @return string */ public function displayPrices($basePrice, $displayPrice) { return $this->defaultColumnRenderer->displayPrices($basePrice, $displayPrice); } }