recent.phtml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. // @codingStandardsIgnoreFile
  7. ?>
  8. <div class="block block-dashboard-orders">
  9. <?php
  10. $_orders = $block->getOrders();
  11. $count = count($_orders);
  12. ?>
  13. <div class="block-title order">
  14. <strong><?= /* @escapeNotVerified */ __('Recent Orders') ?></strong>
  15. <?php if ($count > 0): ?>
  16. <a class="action view" href="<?= /* @escapeNotVerified */ $block->getUrl('sales/order/history') ?>">
  17. <span><?= /* @escapeNotVerified */ __('View All') ?></span>
  18. </a>
  19. <?php endif; ?>
  20. </div>
  21. <div class="block-content">
  22. <?= $block->getChildHtml() ?>
  23. <?php if ($count > 0): ?>
  24. <div class="table-wrapper orders-recent">
  25. <table class="data table table-order-items recent" id="my-orders-table">
  26. <caption class="table-caption"><?= /* @escapeNotVerified */ __('Recent Orders') ?></caption>
  27. <thead>
  28. <tr>
  29. <th scope="col" class="col id"><?= /* @escapeNotVerified */ __('Order #') ?></th>
  30. <th scope="col" class="col date"><?= /* @escapeNotVerified */ __('Date') ?></th>
  31. <th scope="col" class="col shipping"><?= /* @escapeNotVerified */ __('Ship To') ?></th>
  32. <th scope="col" class="col total"><?= /* @escapeNotVerified */ __('Order Total') ?></th>
  33. <th scope="col" class="col status"><?= /* @escapeNotVerified */ __('Status') ?></th>
  34. <th scope="col" class="col actions"><?= /* @escapeNotVerified */ __('Action') ?></th>
  35. </tr>
  36. </thead>
  37. <tbody>
  38. <?php foreach ($_orders as $_order): ?>
  39. <tr>
  40. <td data-th="<?= $block->escapeHtml(__('Order #')) ?>" class="col id"><?= /* @escapeNotVerified */ $_order->getRealOrderId() ?></td>
  41. <td data-th="<?= $block->escapeHtml(__('Date')) ?>" class="col date"><?= /* @escapeNotVerified */ $block->formatDate($_order->getCreatedAt()) ?></td>
  42. <td data-th="<?= $block->escapeHtml(__('Ship To')) ?>" class="col shipping"><?= $_order->getShippingAddress() ? $block->escapeHtml($_order->getShippingAddress()->getName()) : '&nbsp;' ?></td>
  43. <td data-th="<?= $block->escapeHtml(__('Order Total')) ?>" class="col total"><?= /* @escapeNotVerified */ $_order->formatPrice($_order->getGrandTotal()) ?></td>
  44. <td data-th="<?= $block->escapeHtml(__('Status')) ?>" class="col status"><?= /* @escapeNotVerified */ $_order->getStatusLabel() ?></td>
  45. <td data-th="<?= $block->escapeHtml(__('Actions')) ?>" class="col actions">
  46. <a href="<?= /* @escapeNotVerified */ $block->getViewUrl($_order) ?>" class="action view">
  47. <span><?= /* @escapeNotVerified */ __('View Order') ?></span>
  48. </a>
  49. <?php if ($this->helper('Magento\Sales\Helper\Reorder')->canReorder($_order->getEntityId())) : ?>
  50. <a href="#" data-post='<?php /* @escapeNotVerified */ echo
  51. $this->helper(\Magento\Framework\Data\Helper\PostHelper::class)
  52. ->getPostData($block->getReorderUrl($_order))
  53. ?>' class="action order">
  54. <span><?= /* @escapeNotVerified */ __('Reorder') ?></span>
  55. </a>
  56. <?php endif ?>
  57. </td>
  58. </tr>
  59. <?php endforeach; ?>
  60. </tbody>
  61. </table>
  62. </div>
  63. <?php else: ?>
  64. <div class="message info empty"><span><?= /* @escapeNotVerified */ __('You have placed no orders.') ?></span></div>
  65. <?php endif; ?>
  66. </div>
  67. </div>