Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
renderer.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
9 ?>
10 <?php ?>
11 
12 <?php $_item = $block->getItem() ?>
13 <?php $items = array_merge([$_item->getOrderItem()], $_item->getOrderItem()->getChildrenItems()) ?>
14 <?php $shipItems = $block->getChildren($_item) ?>
15 <?php $_count = count($items) ?>
16 <?php $_index = 0 ?>
17 
18 <?php $_prevOptionId = '' ?>
19 
20 <?php if ($block->getOrderOptions() || $_item->getDescription()): ?>
21  <?php $_showlastRow = true ?>
22 <?php else: ?>
23  <?php $_showlastRow = false ?>
24 <?php endif; ?>
25 
26 <?php foreach ($items as $_item): ?>
27  <?php $block->setPriceDataObject($_item) ?>
28  <?php if ($_item->getParentItem()): ?>
29  <?php $attributes = $block->getSelectionAttributes($_item) ?>
30  <?php if ($_prevOptionId != $attributes['option_id']): ?>
31  <tr>
32  <td class="col-product"><div class="option-label"><?= /* @escapeNotVerified */ $attributes['option_label'] ?></div></td>
33  <td class="col-qty last">&nbsp;</td>
34  </tr>
35  <?php $_prevOptionId = $attributes['option_id'] ?>
36  <?php endif; ?>
37  <?php endif; ?>
38  <tr<?= (++$_index == $_count && !$_showlastRow) ? ' class="border"' : '' ?>>
39  <?php if (!$_item->getParentItem()): ?>
40  <td class="col-product">
41  <div class="product-title"><?= $block->escapeHtml($_item->getName()) ?></div>
42  <div class="product-sku-block">
43  <span><?= /* @escapeNotVerified */ __('SKU') ?>:</span>
44  <?= implode('<br />', $this->helper('Magento\Catalog\Helper\Data')->splitSku($block->escapeHtml($_item->getSku()))) ?>
45  </div>
46  </td>
47  <?php else: ?>
48  <td class="col-product"><div class="option-value"><?= $block->getValueHtml($_item) ?></div></td>
49  <?php endif; ?>
50  <td class="col-qty last">
51  <?php if (($block->isShipmentSeparately() && $_item->getParentItem()) || (!$block->isShipmentSeparately() && !$_item->getParentItem())): ?>
52  <?php if (isset($shipItems[$_item->getId()])): ?>
53  <?= /* @escapeNotVerified */ $shipItems[$_item->getId()]->getQty()*1 ?>
54  <?php elseif ($_item->getIsVirtual()): ?>
55  <?= /* @escapeNotVerified */ __('N/A') ?>
56  <?php else: ?>
57  0
58  <?php endif; ?>
59  <?php else: ?>
60  &nbsp;
61  <?php endif; ?>
62  </td>
63  </tr>
64 <?php endforeach; ?>
65 <?php if ($_showlastRow): ?>
66  <tr class="border">
67  <td class="col-product">
68  <?php if ($block->getOrderOptions($_item->getOrderItem())): ?>
69  <dl class="item-options">
70  <?php foreach ($block->getOrderOptions($_item->getOrderItem()) as $option): ?>
71  <dt><?= /* @escapeNotVerified */ $option['label'] ?></dt>
72  <dd>
73  <?php if (isset($option['custom_view']) && $option['custom_view']): ?>
74  <?= /* @escapeNotVerified */ $option['value'] ?>
75  <?php else: ?>
76  <?= $block->truncateString($option['value'], 55, '', $_remainder) ?>
77  <?php if ($_remainder):?>
78  ... <span id="<?= /* @escapeNotVerified */ $_id = 'id' . uniqid() ?>"><?= /* @escapeNotVerified */ $_remainder ?></span>
79  <script>
80 require(['prototype'], function(){
81 
82  $('<?= /* @escapeNotVerified */ $_id ?>').hide();
83  $('<?= /* @escapeNotVerified */ $_id ?>').up().observe('mouseover', function(){$('<?= /* @escapeNotVerified */ $_id ?>').show();});
84  $('<?= /* @escapeNotVerified */ $_id ?>').up().observe('mouseout', function(){$('<?= /* @escapeNotVerified */ $_id ?>').hide();});
85 
86 });
87 </script>
88  <?php endif;?>
89  <?php endif;?>
90  </dd>
91  <?php endforeach; ?>
92  </dl>
93  <?php endif; ?>
94  <?= $block->escapeHtml($_item->getDescription()) ?>
95  </td>
96  <td class="last">&nbsp;</td>
97  </tr>
98 <?php endif; ?>
</td ></tr > $_prevOptionId endif
Definition: renderer.phtml:46
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
$_item $items
Definition: renderer.phtml:18
endforeach
Definition: renderer.phtml:175
__()
Definition: __.php:13
$block
Definition: block.php:8
$_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
$attributes
Definition: matrix.phtml:13
$_count
Definition: left.phtml:19