Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
history.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
9 ?>
10 <?php $_orders = $block->getOrders(); ?>
11 <?= $block->getChildHtml('info') ?>
12 <?php if ($_orders && count($_orders)): ?>
13  <div class="table-wrapper orders-history">
14  <table class="data table table-order-items history" id="my-orders-table">
15  <caption class="table-caption"><?= /* @escapeNotVerified */ __('Orders') ?></caption>
16  <thead>
17  <tr>
18  <th scope="col" class="col id"><?= /* @escapeNotVerified */ __('Order #') ?></th>
19  <th scope="col" class="col date"><?= /* @escapeNotVerified */ __('Date') ?></th>
20  <?= /* @noEscape */ $block->getChildHtml('extra.column.header') ?>
21  <th scope="col" class="col shipping"><?= /* @escapeNotVerified */ __('Ship To') ?></th>
22  <th scope="col" class="col total"><?= /* @escapeNotVerified */ __('Order Total') ?></th>
23  <th scope="col" class="col status"><?= /* @escapeNotVerified */ __('Status') ?></th>
24  <th scope="col" class="col actions"><?= /* @escapeNotVerified */ __('Action') ?></th>
25  </tr>
26  </thead>
27  <tbody>
28  <?php foreach ($_orders as $_order): ?>
29  <tr>
30  <td data-th="<?= $block->escapeHtml(__('Order #')) ?>" class="col id"><?= /* @escapeNotVerified */ $_order->getRealOrderId() ?></td>
31  <td data-th="<?= $block->escapeHtml(__('Date')) ?>" class="col date"><?= /* @escapeNotVerified */ $block->formatDate($_order->getCreatedAt()) ?></td>
32  <?php $extra = $block->getChildBlock('extra.container'); ?>
33  <?php if ($extra): ?>
34  <?php $extra->setOrder($_order); ?>
35  <?= /* @noEscape */ $extra->getChildHtml() ?>
36  <?php endif; ?>
37  <td data-th="<?= $block->escapeHtml(__('Ship To')) ?>" class="col shipping"><?= $_order->getShippingAddress() ? $block->escapeHtml($_order->getShippingAddress()->getName()) : '&nbsp;' ?></td>
38  <td data-th="<?= $block->escapeHtml(__('Order Total')) ?>" class="col total"><?= /* @escapeNotVerified */ $_order->formatPrice($_order->getGrandTotal()) ?></td>
39  <td data-th="<?= $block->escapeHtml(__('Status')) ?>" class="col status"><?= /* @escapeNotVerified */ $_order->getStatusLabel() ?></td>
40  <td data-th="<?= $block->escapeHtml(__('Actions')) ?>" class="col actions">
41  <a href="<?= /* @escapeNotVerified */ $block->getViewUrl($_order) ?>" class="action view">
42  <span><?= /* @escapeNotVerified */ __('View Order') ?></span>
43  </a>
44  <?php if ($this->helper('Magento\Sales\Helper\Reorder')->canReorder($_order->getEntityId())) : ?>
45  <a href="#" data-post='<?php /* @escapeNotVerified */ echo
46  $this->helper(\Magento\Framework\Data\Helper\PostHelper::class)
47  ->getPostData($block->getReorderUrl($_order))
48  ?>' class="action order">
49  <span><?= /* @escapeNotVerified */ __('Reorder') ?></span>
50  </a>
51  <?php endif ?>
52  </td>
53  </tr>
54  <?php endforeach; ?>
55  </tbody>
56  </table>
57  </div>
58  <?php if ($block->getPagerHtml()): ?>
59  <div class="order-products-toolbar toolbar bottom"><?= $block->getPagerHtml() ?></div>
60  <?php endif ?>
61 <?php else: ?>
62  <div class="message info empty"><span><?= /* @escapeNotVerified */ __('You have placed no orders.') ?></span></div>
63 <?php endif ?>
endif
Definition: history.phtml:66
$parentItem $_order
Definition: default.phtml:12
__()
Definition: __.php:13
$block
Definition: block.php:8
if( $block->canAddComment())( 'Status') ?></label >< div class if($_code==$block->getOrder() ->getStatus()) endforeach
Definition: history.phtml:19
$_orders
Definition: history.phtml:10
if( $_orders &&count( $_orders))( 'Orders') ?></caption >< thead >< tr >< th scopeforeach( $_orders as $_order)(__( 'Order #')) ?>" class $extra
Definition: history.phtml:32