tax.phtml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. // @codingStandardsIgnoreFile
  7. ?>
  8. <?php
  9. $_order = $block->getOrder();
  10. $_source = $block->getSource();
  11. $_fullInfo = $this->helper('Magento\Tax\Helper\Data')->getCalculatedTaxes($_source);
  12. global $taxIter; $taxIter++;
  13. ?>
  14. <?php if ($_fullInfo && $block->displayFullSummary()): ?>
  15. <?php foreach ($_fullInfo as $info): ?>
  16. <?php
  17. $percent = $info['percent'];
  18. $amount = $info['tax_amount'];
  19. $baseAmount = $info['base_tax_amount'];
  20. $title = $info['title'];
  21. ?>
  22. <tr class="totals tax details details-<?= /* @escapeNotVerified */ $taxIter ?> <?= ($block->getIsPlaneMode()) ? ' plane' : '' ?>">
  23. <td <?= /* @escapeNotVerified */ $block->getLabelProperties() ?>>
  24. <?= $block->escapeHtml($title) ?>
  25. <?php if (!is_null($percent)): ?>
  26. (<?= (float)$percent ?>%)
  27. <?php endif; ?>
  28. <br />
  29. </td>
  30. <td <?= /* @escapeNotVerified */ $block->getValueProperties() ?> rowspan="1">
  31. <?= /* @escapeNotVerified */ $_order->formatPrice($amount) ?>
  32. </td>
  33. </tr>
  34. <?php endforeach; ?>
  35. <?php endif;?>
  36. <?php if ($block->displayFullSummary() && $_fullInfo && !$block->getIsPlaneMode()): ?>
  37. <tr class="totals-tax-summary">
  38. <?php elseif ($block->displayFullSummary() && $_fullInfo && $block->getIsPlaneMode()): ?>
  39. <tr class="totals-tax-summary plane">
  40. <?php else: ?>
  41. <tr class="totals-tax">
  42. <?php endif; ?>
  43. <th <?= /* @escapeNotVerified */ $block->getLabelProperties() ?> scope="row">
  44. <?php if ($block->displayFullSummary()): ?>
  45. <div class="detailed"><?= /* @escapeNotVerified */ __('Tax') ?></div>
  46. <?php else: ?>
  47. <?= /* @escapeNotVerified */ __('Tax') ?>
  48. <?php endif;?>
  49. </th>
  50. <td <?= /* @escapeNotVerified */ $block->getValueProperties() ?> data-th="<?= $block->escapeHtml(__('Tax')) ?>">
  51. <?= /* @escapeNotVerified */ $_order->formatPrice($_source->getTaxAmount()) ?>
  52. </td>
  53. </tr>