When want to have the following style of totals on checkout/cart
:
- Discount
- Subtotal
- Shipping fee OR Info Text: "excl. shipping"
- Additional text: "free shipping from 30EUR" (display always)
- Grand total
- incl. Tax
Problems
- Even if we set "Checkout Totals Sort Order" in the backend correctly, the grand total is always displayed at the end
- How to put any additional info blocks between the totals?
- How to display an info text, if one total is not present (shipping)
Best Answer
partial answer
1. Order in Backend does not fully affect rendering
template\checkout\cart\totals.phtml
.-1
torenderTotals()
renders all areas.So you have to remove
$this->renderTotals('footer');
and change$this->renderTotals();
to$this->renderTotals(-1);
Example (after copying
totals.phtml
to your own theme):After this change, the order configured in the back-end works as expected.