How can I change the position of the order totals (incl. tax / excl. tax) in the tax calculation? As it should show the total including tax below the total excluding tax but at the moment it does not.
1 Answer
Other than the single totals (subtotal, tax, shipping, discount) which you can reorder in Stores > Configuration > Sales > Sales > Checkout Totals Sort Order, the grand totals are hard coded in the template
Magento/Tax/view/frontend/web/template/checkout/cart/totals/grand-total.html
<tr class="grand totals incl">
<th class="mark" scope="row">
<strong data-bind="i18n: inclTaxLabel"></strong>
</th>
<td data-bind="attr: {'data-th': inclTaxLabel}" class="amount">
<strong><span class="price" data-bind="text: getValue()"></span></strong>
</td>
</tr>
<tr class="grand totals excl">
<th class="mark" scope="row">
<strong data-bind="i18n: exclTaxLabel"></strong>
</th>Magento/Tax/view/frontend/web/template/checkout/summary/grand-total.html
<td data-bind="attr: {'data-th': exclTaxLabel}" class="amount">
<strong><span class="price" data-bind="text: getGrandTotalExclTax()"></span></strong>
</td>
</tr>
Override this template in your theme and change the order of these two <tr>
table rows.
This template is for the cart. For the checkout summary, do the same in Magento/Tax/view/frontend/web/template/checkout/summary/grand-total.html
-
Hi thanks for that quick reply, where do i find this coding page? Commented Sep 14, 2016 at 10:35
-
-
The files are either in
app/code/Magento/Tax/view/...
orvendor/magento/module-tax/view/...
, depending on your type of installation. But you should never change core files directly. Instead, copy them to your theme and modify them there. You can learn about template overriding and custom themes here: devdocs.magento.com/guides/v2.1/frontend-dev-guide/templates/… Commented Sep 14, 2016 at 10:40