Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
view.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
9 ?>
10 <?php ?>
11 <div class="admin__control-table-wrapper">
12  <table class="data-table admin__control-table" id="shipment_tracking_info">
13  <thead>
14  <tr class="headings">
15  <th class="col-carrier"><?= /* @escapeNotVerified */ __('Carrier') ?></th>
16  <th class="col-title"><?= /* @escapeNotVerified */ __('Title') ?></th>
17  <th class="col-number"><?= /* @escapeNotVerified */ __('Number') ?></th>
18  <th class="col-delete last"><?= /* @escapeNotVerified */ __('Action') ?></th>
19  </tr>
20  </thead>
21  <tfoot>
22  <tr>
23  <td class="col-carrier">
24  <select name="carrier"
25  class="select admin__control-select"
26  onchange="selectCarrier(this)">
27  <?php foreach ($block->getCarriers() as $_code => $_name): ?>
28  <option value="<?= /* @escapeNotVerified */ $_code ?>"><?= $block->escapeHtml($_name) ?></option>
29  <?php endforeach; ?>
30  </select>
31  </td>
32  <td class="col-title">
33  <input class="input-text admin__control-text"
34  type="text"
35  id="tracking_title"
36  name="title"
37  value="" />
38  </td>
39  <td class="col-number">
40  <input class="input-text admin__control-text"
41  type="text"
42  id="tracking_number"
43  name="number"
44  value="" />
45  </td>
46  <td class="col-delete last"><?= $block->getSaveButtonHtml() ?></td>
47  </tr>
48  </tfoot>
49  <?php if ($_tracks = $block->getShipment()->getAllTracks()): ?>
50  <tbody>
51  <?php $i = 0; foreach ($_tracks as $_track):$i++ ?>
52  <tr class="<?= /* @escapeNotVerified */ ($i%2 == 0) ? 'even' : 'odd' ?>">
53  <td class="col-carrier"><?= $block->escapeHtml($block->getCarrierTitle($_track->getCarrierCode())) ?></td>
54  <td class="col-title"><?= $block->escapeHtml($_track->getTitle()) ?></td>
55  <td class="col-number">
56  <?php if ($_track->isCustom()): ?>
57  <?= $block->escapeHtml($_track->getNumber()) ?>
58  <?php else: ?>
59  <a href="#" onclick="popWin('<?= /* @escapeNotVerified */ $this->helper('Magento\Shipping\Helper\Data')->getTrackingPopupUrlBySalesModel($_track) ?>','trackorder','width=800,height=600,resizable=yes,scrollbars=yes')"><?= $block->escapeHtml($_track->getNumber()) ?></a>
60  <div id="shipment_tracking_info_response_<?= /* @escapeNotVerified */ $_track->getId() ?>"></div>
61  <?php endif; ?>
62  </td>
63  <td class="col-delete last"><button class="action-delete" type="button" onclick="deleteTrackingNumber('<?= /* @escapeNotVerified */ $block->getRemoveUrl($_track) ?>'); return false;"><span><?= /* @escapeNotVerified */ __('Delete') ?></span></button></td>
64  </tr>
65  <?php endforeach; ?>
66  </tbody>
67  <?php endif; ?>
68  </table>
69 </div>
70 
71 <script>
72 require(['prototype'], function(){
73 
74 //<![CDATA[
75 function selectCarrier(elem) {
76  var option = elem.options[elem.selectedIndex];
77  $('tracking_title').value = option.value && option.value != 'custom' ? option.text : '';
78 }
79 
80 function deleteTrackingNumber(url) {
81  if (confirm('<?= /* @escapeNotVerified */ __('Are you sure?') ?>')) {
82  submitAndReloadArea($('shipment_tracking_info').parentNode, url)
83  }
84 }
85 
86 window.selectCarrier = selectCarrier;
87 window.deleteTrackingNumber = deleteTrackingNumber;
88 //]]>
89 
90 });
91 </script>
$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
endforeach
Definition: view.phtml:42
__()
Definition: __.php:13
$_code
Definition: attribute.phtml:19
$block
Definition: block.php:8
$i
Definition: gallery.phtml:31
if( $block->canShowBlock())( 'Shop By') ?></strong ></div >< div classif( $block->getLayer() ->getState() ->getFilters())() ?>" class endif
Definition: view.phtml:27