charges.phtml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Refer to LICENSE.txt distributed with the Temando Shipping module for notice of license
  4. */
  5. ?>
  6. <?php
  7. /** @var \Magento\Backend\Block\Template $block */
  8. /** @var \Temando\Shipping\ViewModel\Dispatch\DispatchView $viewModel */
  9. $viewModel = $block->getData('viewModel');
  10. /** @var \Temando\Shipping\Model\Dispatch\PickupChargeInterface[] $charges */
  11. $charges = $viewModel->getPickupCharges();
  12. ?>
  13. <?php if (!empty($charges)) : ?>
  14. <section class="admin__page-section">
  15. <div class="admin__page-section-title">
  16. <span class="title"><?= $block->escapeHtml(__('Pickup Rates')) ?></span>
  17. </div>
  18. <div class="admin__page-section-content">
  19. <div class="admin__page-section-item">
  20. <table class="data-table admin__table-secondary ">
  21. <tbody>
  22. <?php foreach ($charges as $charge) : ?>
  23. <?php $priceHtml = $viewModel->formatPrice($charge->getCurrency(), $charge->getAmount()); ?>
  24. <tr>
  25. <td><?= $block->escapeHtml($charge->getDescription()); ?></td>
  26. <td><?= /* @noEscape */ $priceHtml; ?></td>
  27. </tr>
  28. <?php endforeach; ?>
  29. </tbody>
  30. </table>
  31. </div>
  32. </div>
  33. </section>
  34. <?php endif; ?>