-
Notifications
You must be signed in to change notification settings - Fork 9.4k
/
Copy pathtax.phtml
59 lines (55 loc) · 2.25 KB
/
tax.phtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// phpcs:disable Magento2.Templates.ThisInTemplate
// phpcs:disable Squiz.PHP.GlobalKeyword.NotAllowed
?>
<?php
$_order = $block->getOrder();
$_source = $block->getSource();
$_fullInfo = $this->helper(\Magento\Tax\Helper\Data::class)->getCalculatedTaxes($_source);
global $taxIter;
$taxIter++;
?>
<?php if ($_fullInfo && $block->displayFullSummary()) : ?>
<?php foreach ($_fullInfo as $info) : ?>
<?php
$percent = $info['percent'];
$amount = $info['tax_amount'];
$baseAmount = $info['base_tax_amount'];
$title = $info['title'];
?>
<tr class="totals tax details details-<?= (int) $taxIter ?><?= ($block->getIsPlaneMode()) ? ' plane' : '' ?>">
<td <?= /* @noEscape */ $block->getLabelProperties() ?>>
<?= $block->escapeHtml($title) ?>
<?php if ($percent !== null) : ?>
(<?= number_format((float)$percent, 1, ',', '') ?>%)
<?php endif; ?>
<br />
</td>
<td <?= /* @noEscape */ $block->getValueProperties() ?> rowspan="1">
<?= /* @noEscape */ $_order->formatPrice($amount) ?>
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
<?php if ($block->displayFullSummary() && $_fullInfo && !$block->getIsPlaneMode()) : ?>
<tr class="totals-tax-summary">
<?php elseif ($block->displayFullSummary() && $_fullInfo && $block->getIsPlaneMode()) : ?>
<tr class="totals-tax-summary plane">
<?php else : ?>
<tr class="totals-tax">
<?php endif; ?>
<th <?= /* @noEscape */ $block->getLabelProperties() ?> scope="row">
<?php if ($block->displayFullSummary()) : ?>
<div class="detailed"><?= $block->escapeHtml(__('Tax')) ?></div>
<?php else : ?>
<?= $block->escapeHtml(__('Tax')) ?>
<?php endif; ?>
</th>
<td <?= /* @noEscape */ $block->getValueProperties() ?> data-th="<?= $block->escapeHtmlAttr(__('Tax')) ?>">
<?= /* @noEscape */ $_order->formatPrice($_source->getTaxAmount()) ?>
</td>
</tr>