tax.phtml 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. // @codingStandardsIgnoreFile
  7. /**
  8. * @var $block \Magento\Tax\Block\Checkout\Tax
  9. * @see \Magento\Tax\Block\Checkout\Tax
  10. */
  11. ?>
  12. <?php
  13. $_value = $block->getTotal()->getValue();
  14. $_style = $block->getTotal()->getStyle();
  15. ?>
  16. <?php global $taxIter; $taxIter++; ?>
  17. <?php
  18. $attributes = 'class="totals-tax"';
  19. if ($this->helper('Magento\Tax\Helper\Data')->displayFullSummary() && $_value != 0) {
  20. $attributes = 'class="totals-tax-summary" data-mage-init=\'{"toggleAdvanced": {"selectorsToggleClass": "shown", "baseToggleClass": "expanded", "toggleContainers": ".totals-tax-details"}}\'';
  21. }
  22. ?>
  23. <tr <?= /* @escapeNotVerified */ $attributes ?>>
  24. <th style="<?= /* @escapeNotVerified */ $_style ?>" class="mark" colspan="<?= /* @escapeNotVerified */ $block->getColspan() ?>" scope="row">
  25. <?php if ($this->helper('Magento\Tax\Helper\Data')->displayFullSummary()): ?>
  26. <span class="detailed"><?= /* @escapeNotVerified */ $block->getTotal()->getTitle() ?></span>
  27. <?php else: ?>
  28. <?= /* @escapeNotVerified */ $block->getTotal()->getTitle() ?>
  29. <?php endif;?>
  30. </th>
  31. <td style="<?= /* @escapeNotVerified */ $_style ?>" class="amount" data-th="<?= $block->escapeHtml($block->getTotal()->getTitle()) ?>">
  32. <?= /* @escapeNotVerified */ $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_value) ?>
  33. </td>
  34. </tr>
  35. <?php if ($this->helper('Magento\Tax\Helper\Data')->displayFullSummary() && $_value != 0): ?>
  36. <?php foreach ($block->getTotal()->getFullInfo() as $info): ?>
  37. <?php if (isset($info['hidden']) && $info['hidden']) {
  38. continue;
  39. } ?>
  40. <?php $percent = $info['percent']; ?>
  41. <?php $amount = $info['amount']; ?>
  42. <?php $rates = $info['rates']; ?>
  43. <?php $isFirst = 1; ?>
  44. <?php foreach ($rates as $rate): ?>
  45. <tr class="totals-tax-details details-<?= /* @escapeNotVerified */ $taxIter ?>">
  46. <th class="mark" style="<?= /* @escapeNotVerified */ $_style ?>" colspan="<?= /* @escapeNotVerified */ $block->getColspan() ?>" scope="row">
  47. <?= $block->escapeHtml($rate['title']) ?>
  48. <?php if (!is_null($rate['percent'])): ?>
  49. (<?= (float)$rate['percent'] ?>%)
  50. <?php endif; ?>
  51. </th>
  52. <?php if ($isFirst): ?>
  53. <td style="<?= /* @escapeNotVerified */ $_style ?>" class="amount" rowspan="<?= count($rates) ?>"
  54. data-th="<?= $block->escapeHtml($rate['title']) ?><?php if (!is_null($rate['percent'])): ?>(<?= (float)$rate['percent'] ?>%)<?php endif; ?>">
  55. <?= /* @escapeNotVerified */ $this->helper('Magento\Checkout\Helper\Data')->formatPrice($amount) ?>
  56. </td>
  57. <?php endif; ?>
  58. </tr>
  59. <?php $isFirst = 0; ?>
  60. <?php endforeach; ?>
  61. <?php endforeach; ?>
  62. <?php endif;?>