Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
grid.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
9 ?>
10 <div class="grid">
11  <?php $randomId = rand(); ?>
12  <div class="admin__table-wrapper">
13  <table class="data-grid">
14  <thead>
15  <tr>
16  <th class="data-grid-checkbox-cell">
17  <label class="data-grid-checkbox-cell-inner">
18  <input type="checkbox"
19  id="select-items-<?= /* @noEscape */ $randomId ?>"
20  onchange="packaging.checkAllItems(this);"
21  class="checkbox admin__control-checkbox"
22  title="<?= /* @escapeNotVerified */ __('Select All') ?>">
23  <label for="select-items-<?= /* @noEscape */ $randomId ?>"></label>
24  </label>
25  </th>
26  <th class="data-grid-th"><?= /* @escapeNotVerified */ __('Product Name') ?></th>
27  <th class="data-grid-th"><?= /* @escapeNotVerified */ __('Weight') ?></th>
28  <th class="data-grid-th" <?= $block->displayCustomsValue() ? '' : 'style="display: none;"' ?>>
29  <?= /* @escapeNotVerified */ __('Customs Value') ?>
30  </th>
31  <th class="data-grid-th"><?= /* @escapeNotVerified */ __('Qty Ordered') ?></th>
32  <th class="data-grid-th"><?= /* @escapeNotVerified */ __('Qty') ?></th>
33  </tr>
34  </thead>
35  <tbody>
36  <?php $i=0; ?>
37  <?php foreach ($block->getCollection() as $item): ?>
38  <?php
39  $_order = $block->getShipment()->getOrder();
40  $_orderItem = $_order->getItemById($item->getOrderItemId());
41  ?>
42  <?php if ($item->getIsVirtual()
43  || ($_orderItem->isShipSeparately() && !($_orderItem->getParentItemId() || $_orderItem->getParentItem()))
44  || (!$_orderItem->isShipSeparately() && ($_orderItem->getParentItemId() || $_orderItem->getParentItem()))): ?>
45  <?php continue; ?>
46  <?php endif; ?>
47  <tr class="data-grid-controls-row data-row <?= ($i++ % 2 != 0) ? '_odd-row' : '' ?>">
48  <td class="data-grid-checkbox-cell">
49  <?php $id = $item->getId() ? $item->getId() : $item->getOrderItemId(); ?>
50  <label class="data-grid-checkbox-cell-inner">
51  <input type="checkbox"
52  name=""
53  id="select-item-<?= /* @noEscape */ $randomId . '-' . $id ?>"
54  value="<?= /* @escapeNotVerified */ $id ?>"
55  class="checkbox admin__control-checkbox">
56  <label for="select-item-<?= /* @noEscape */ $randomId . '-' . $id ?>"></label>
57  </label>
58  </td>
59  <td>
60  <?= /* @escapeNotVerified */ $item->getName() ?>
61  </td>
62  <td data-role="item-weight">
63  <?= /* @escapeNotVerified */ $item->getWeight() ?>
64  </td>
65  <?php
66  if ($block->displayCustomsValue()) {
67  $customsValueDisplay = '';
68  $customsValueValidation = ' validate-zero-or-greater ';
69  } else {
70  $customsValueDisplay = ' style="display: none;" ';
72  }
73 
74  ?>
75  <td <?= /* @escapeNotVerified */ $customsValueDisplay ?>>
76  <input type="text"
77  name="customs_value"
78  class="input-text admin__control-text <?= /* @escapeNotVerified */ $customsValueValidation ?>"
79  value="<?= /* @escapeNotVerified */ $block->formatPrice($item->getPrice()) ?>"
80  size="10"
81  onblur="packaging.recalcContainerWeightAndCustomsValue(this);">
82  </td>
83  <td>
84  <?= /* @escapeNotVerified */ $item->getOrderItem()->getQtyOrdered()*1 ?>
85  </td>
86  <td>
87  <input type="hidden" name="price" value="<?= /* @escapeNotVerified */ $item->getPrice() ?>">
88  <input type="text"
89  name="qty"
90  value="<?= /* @escapeNotVerified */ $item->getQty()*1 ?>"
91  class="input-text admin__control-text qty<?php if ($item->getOrderItem()->getIsQtyDecimal()): ?> qty-decimal<?php endif ?>">&nbsp;
92  <button type="button" class="action-delete" data-action="package-delete-item" onclick="packaging.deleteItem(this);" style="display:none;">
93  <span><?= /* @escapeNotVerified */ __('Delete') ?></span>
94  </button>
95  </td>
96  </tr>
97  <?php endforeach; ?>
98  </tbody>
99  </table>
100  </div>
101 </div>
$_orderItem
Definition: grid.phtml:40
$block setTitle( 'CMS Block Title') -> setIdentifier('fixture_block') ->setContent('< h1 >Fixture Block Title</h1 >< a href=" store url</a><p> Config value
Definition: block.php:9
$parentItem $_order
Definition: default.phtml:12
__()
Definition: __.php:13
$customsValueValidation
Definition: grid.phtml:71
$block
Definition: block.php:8
endif
Definition: grid.phtml:31
$_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
$i
Definition: grid.phtml:36
$id
Definition: grid.phtml:49
$randomId
Definition: grid.phtml:11
foreach( $block->getColumns() as $_column)() ?><? endforeach
Definition: grid.phtml:39