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