Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
default.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
9 ?>
10 <?php ?>
11 <?php $parentItem = $block->getItem() ?>
12 <?php $_order = $block->getItem()->getOrder(); ?>
13 
14 <?php $items = $block->getChildren($parentItem) ?>
15 
16 <?php if ($block->getItemOptions() || $parentItem->getDescription() || $this->helper('Magento\GiftMessage\Helper\Message')->isMessagesAllowed('order_item', $parentItem) && $parentItem->getGiftMessageId()): ?>
17  <?php $_showlastRow = true ?>
18 <?php else: ?>
19  <?php $_showlastRow = false ?>
20 <?php endif; ?>
21 
22 <?php $_prevOptionId = '' ?>
23 
24 <?php foreach ($items as $_item): ?>
25 
26  <?php
27  // As part of invoice item renderer logic, the order is set on each invoice item.
28  // In the case of a bundle product, this template takes over rendering its children,
29  // so it is necessary to pass the order along to each child.
30  $_item->setOrder($_order);
31  ?>
32 
33  <?php if ($_item->getOrderItem()->getParentItem()): ?>
34  <?php $attributes = $block->getSelectionAttributes($_item) ?>
35  <?php if ($_prevOptionId != $attributes['option_id']): ?>
36  <tr class="bundle-option-label">
37  <td colspan="3">
38  <strong><?= /* @escapeNotVerified */ $attributes['option_label'] ?></strong>
39  </td>
40  </tr>
41  <?php $_prevOptionId = $attributes['option_id'] ?>
42  <?php endif; ?>
43  <?php endif; ?>
44  <?php if (!$_item->getOrderItem()->getParentItem()): ?>
45  <tr class="bundle-item bundle-parent">
46  <td class="item-info">
47  <p class="product-name"><?= $block->escapeHtml($_item->getName()) ?></p>
48  <p class="sku"><?= /* @escapeNotVerified */ __('SKU') ?>: <?= $block->escapeHtml($block->getSku($_item)) ?></p>
49  </td>
50  <?php else: ?>
51  <tr class="bundle-item bundle-option-value">
52  <td class="item-info">
53  <p><?= $block->getValueHtml($_item) ?></p>
54  </td>
55  <?php endif; ?>
56  <td class="item-qty">
57  <?php if ($block->canShowPriceInfo($_item)): ?>
58  <?= /* @escapeNotVerified */ $_item->getQty() * 1 ?>
59  <?php else: ?>
60  &nbsp;
61  <?php endif; ?>
62  </td>
63  <td class="item-price">
64  <?php if ($block->canShowPriceInfo($_item)): ?>
65  <?= /* @escapeNotVerified */ $block->getItemPrice($_item) ?>
66  <?php else: ?>
67  &nbsp;
68  <?php endif; ?>
69  </td>
70  </tr>
71 
72 <?php endforeach; ?>
73 
74 <?php if ($_showlastRow): ?>
75  <tr>
76  <td colspan="3" class="item-extra">
77  <?php if ($block->getItemOptions()): ?>
78  <dl>
79  <?php foreach ($block->getItemOptions() as $option): ?>
80  <dt><strong><em><?= /* @escapeNotVerified */ $option['label'] ?></em></strong></dt>
81  <dd><?= /* @escapeNotVerified */ $option['value'] ?></dd>
82  <?php endforeach; ?>
83  </dl>
84  <?php endif; ?>
85  <?= $block->escapeHtml($_item->getDescription()) ?>
86  </td>
87  </tr>
88 <?php endif; ?>
$option
Definition: default.phtml:8
$parentItem $_order
Definition: default.phtml:12
__()
Definition: __.php:13
$block
Definition: block.php:8
endforeach
Definition: default.phtml:72
$_count $_index $_prevOptionId if($block->getOrderOptions()|| $_item->getDescription()) foreach( $items as $_item)( $_item) ?><?php $attributes if( $_item->getOrderItem() ->getParentItem())($_prevOptionId !=$attributes['option_id'])</td >< td > & nbsp
Definition: renderer.phtml:33
$_item
Definition: default.phtml:11
if( $_item->getOrderItem() ->getParentItem())( $_item) ?><?php if( $_prevOptionId ! $_prevOptionId endif
Definition: default.phtml:41
$attributes
Definition: matrix.phtml:13
$_item $_order $parentItem $items
Definition: default.phtml:15