75 parent::__construct($context,
$data);
86 foreach ($blocks as $blockName) {
88 if (
$block->getRenderedBlock() ===
null) {
89 $block->setRenderedBlock($this);
91 $this->_columnRenders[$blockName] =
$block;
103 public function getItemRenderer(
$type)
107 if (!$renderer instanceof \
Magento\Framework\View\Element\BlockInterface) {
108 throw new \RuntimeException(
'Renderer for type "' .
$type .
'" does not exist.');
124 $column =
'column_' . $column;
125 if (isset($this->_columnRenders[$column .
'_' . $compositePart])) {
126 $column .=
'_' . $compositePart;
128 if (!isset($this->_columnRenders[$column])) {
131 return $this->_columnRenders[$column];
142 if (
$item->getOrderItem()) {
143 $type =
$item->getOrderItem()->getProductType();
148 return $this->getItemRenderer(
$type)->setItem(
$item)->setCanEditQty($this->
canEditQty())->toHtml();
159 $extraInfoBlock = $this->
getChildBlock(
'order_item_extra_info');
160 if ($extraInfoBlock) {
161 return $extraInfoBlock->setItem(
$item)->toHtml();
176 if (
$item->getOrderItem()) {
184 if ($field !==
null) {
199 return $this->_coreRegistry->registry(
'current_creditmemo');
214 if ($this->hasOrder()) {
215 return $this->
getData(
'order');
217 if ($this->_coreRegistry->registry(
'current_order')) {
218 return $this->_coreRegistry->registry(
'current_order');
220 if ($this->_coreRegistry->registry(
'order')) {
221 return $this->_coreRegistry->registry(
'order');
230 return $this->getItem()->getOrder();
233 throw new \Magento\Framework\Exception\LocalizedException(
__(
'We can\'t get the order instance right now.'));
243 $obj = $this->
getData(
'price_data_object');
260 if (
$code ==
'tax_amount' && $this->
getOrder()->getRowTaxDisplayPrecision()) {
264 $this->
getOrder()->getRowTaxDisplayPrecision(),
304 if ($this->
getOrder()->isCurrencyDifferent()) {
306 $res .= $this->
getOrder()->formatBasePricePrecision($basePrice, $precision);
308 $res .= $this->
getOrder()->formatPricePrecision(
$price, $precision,
true);
310 $res = $this->
getOrder()->formatPricePrecision(
$price, $precision);
312 $res =
'<strong>' . $res .
'</strong>';
326 if (
$item->getTaxPercent() &&
$item->getTaxString() ==
'') {
327 $percents = [
$item->getTaxPercent()];
329 $percents = explode(\
Magento\
Tax\Model\Config::CALCULATION_STRING_SEPARATOR,
$item->getTaxString());
337 return implode(
' + ', $percents);
348 if (
$item->getTaxPercent()) {
349 return sprintf(
'%s%%',
$item->getTaxPercent() + 0);
367 if (
$item->getOrderItem()->getQtyToShip()) {
384 $this->_canEditQty =
$value;
398 if ($this->_canEditQty !==
null) {
406 if ($this->
getOrder()->getForcedShipmentWithInvoice()
412 return $this->
getOrder()->getPayment()->canCapturePartial();
424 if ($this->_authorization->isAllowed(
'Magento_Sales::capture')) {
458 return $this->_coreRegistry->registry(
'current_invoice');
467 return $this->stockConfiguration->canSubtractQty(
$store);
478 if (
null !==
$item) {
479 if (!
$item->hasCanReturnToStock()) {
480 $stockItem = $this->stockRegistry->getStockItem(
481 $item->getOrderItem()->getProductId(),
482 $item->getOrderItem()->getStore()->getWebsiteId()
486 return $item->getCanReturnToStock();
500 if (
$item !==
null) {
501 if (
$item->getCreditmemo()->getOrder()->hasCanReturnToStock()) {
502 return $item->getCreditmemo()->getOrder()->getCanReturnToStock();
505 return $this->
getOrder()->getCanReturnToStock();
519 $order = $this->_coreRegistry->registry(
'current_shipment')->getOrder();
537 $order = $this->_coreRegistry->registry(
'current_shipment')->getOrder();
setColumnRenders(array $blocks)
displayPrices($basePrice, $price, $strong=false, $separator='< br/>')
getItemHtml(\Magento\Framework\DataObject $item)
if($this->helper('Magento\Tax\Helper\Data') ->displayFullSummary()) foreach( $block->getTotal() ->getFullInfo() as $info)(isset($info['hidden']) && $info['hidden']) $percent
getData($key='', $index=null)
elseif(isset( $params[ 'redirect_parent']))
displayTaxPercent(\Magento\Framework\DataObject $item)
canShipPartiallyItem($order=null)
canShipPartially($order=null)
canParentReturnToStock($item=null)
displayPriceAttribute($code, $strong=false, $separator='< br/>')
getGroupChildNames($groupName)
canReturnItemToStock($item=null)
getItemExtraInfoHtml(\Magento\Framework\DataObject $item)
getColumnRenderer($column, $compositePart='')
getColumnHtml(\Magento\Framework\DataObject $item, $column, $field=null)
canReturnToStock($store=null)
displayTaxCalculation(\Magento\Framework\DataObject $item)
displayRoundedPrices($basePrice, $price, $precision=2, $strong=false, $separator='< br/>')
__construct(\Magento\Backend\Block\Template\Context $context, \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry, \Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration, \Magento\Framework\Registry $registry, array $data=[])