Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
tax.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
13 ?>
14 <?php
15  $_value = $block->getTotal()->getValue();
16  $_style = $block->getTotal()->getStyle();
17 ?>
18 <?php global $taxIter; $taxIter++; ?>
19 
20 <?php
21  $attributes = 'class="totals-tax"';
22  if ($this->helper('Magento\Tax\Helper\Data')->displayFullSummary() && $_value != 0) {
23  $attributes = 'class="totals-tax-summary" data-mage-init=\'{"toggleAdvanced": {"selectorsToggleClass": "shown", "baseToggleClass": "expanded", "toggleContainers": ".totals-tax-details"}}\'';
24  }
25 ?>
26 
27 <tr <?= /* @escapeNotVerified */ $attributes ?>>
28  <th style="<?= /* @escapeNotVerified */ $_style ?>" class="mark" colspan="<?= /* @escapeNotVerified */ $block->getColspan() ?>" scope="row">
29  <?php if ($this->helper('Magento\Tax\Helper\Data')->displayFullSummary()): ?>
30  <span class="detailed"><?= /* @escapeNotVerified */ $block->getTotal()->getTitle() ?></span>
31  <?php else: ?>
32  <?= /* @escapeNotVerified */ $block->getTotal()->getTitle() ?>
33  <?php endif;?>
34  </th>
35  <td style="<?= /* @escapeNotVerified */ $_style ?>" class="amount" data-th="<?= $block->escapeHtml($block->getTotal()->getTitle()) ?>">
36  <?= /* @escapeNotVerified */ $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_value) ?>
37  </td>
38 </tr>
39 
40 <?php if ($this->helper('Magento\Tax\Helper\Data')->displayFullSummary() && $_value != 0): ?>
41  <?php foreach ($block->getTotal()->getFullInfo() as $info): ?>
42  <?php if (isset($info['hidden']) && $info['hidden']) {
43  continue;
44  } ?>
45  <?php $percent = $info['percent']; ?>
46  <?php $amount = $info['amount']; ?>
47  <?php $rates = $info['rates']; ?>
48  <?php $isFirst = 1; ?>
49 
50  <?php foreach ($rates as $rate): ?>
51  <tr class="totals-tax-details details-<?= /* @escapeNotVerified */ $taxIter ?>">
52  <th class="mark" style="<?= /* @escapeNotVerified */ $_style ?>" colspan="<?= /* @escapeNotVerified */ $block->getColspan() ?>" scope="row">
53  <?= $block->escapeHtml($rate['title']) ?>
54  <?php if (!is_null($rate['percent'])): ?>
55  (<?= (float)$rate['percent'] ?>%)
56  <?php endif; ?>
57  </th>
58  <?php if ($isFirst): ?>
59  <td style="<?= /* @escapeNotVerified */ $_style ?>" class="amount" rowspan="<?= count($rates) ?>"
60  data-th="<?= $block->escapeHtml($rate['title']) ?><?php if (!is_null($rate['percent'])): ?>(<?= (float)$rate['percent'] ?>%)<?php endif; ?>">
61  <?= /* @escapeNotVerified */ $this->helper('Magento\Checkout\Helper\Data')->formatPrice($amount) ?>
62  </td>
63  <?php endif; ?>
64  </tr>
65  <?php $isFirst = 0; ?>
66  <?php endforeach; ?>
67  <?php endforeach; ?>
68 <?php endif;?>
$attributes
Definition: tax.phtml:21
if($this->helper('Magento\Tax\Helper\Data') ->displayFullSummary()) foreach( $block->getTotal() ->getFullInfo() as $info)(isset($info['hidden']) && $info['hidden']) $percent
Definition: tax.phtml:33
$amount
Definition: tax.phtml:34
$rates
Definition: tax.phtml:35
$block
Definition: block.php:8
$_style
Definition: tax.phtml:16
endforeach
Definition: tax.phtml:55
foreach( $rates as $rate)($isTop) endif
Definition: tax.phtml:38
foreach( $_productCollection as $_product)() ?>" class $info
Definition: listing.phtml:52
$_value
Definition: tax.phtml:15
$isFirst
Definition: tax.phtml:36
if(($taxAmount==0 && $this->helper('Magento\Tax\Helper\Data') ->displayZeroTax())||($taxAmount > 0)) $taxIter
Definition: tax.phtml:11