A quick post here, which is more of a note to myself, because I’ve just spent one hour digging through methods for this. If you want to display the total price including or excluding VAT in Magento, using strictly methods already integrated in Magento, use the below code to call these in a pre-formatted way.
The code displayed below you can use save the output to a variable (e.g.
$subTotal) and manipulate it. You can also use it to display (
echo) the output anywhere on your page (e.g.
minicart.phtml). Which is what I used it for.
Get Price of all Items in Cart including VAT/Tax
Some themes display the subtotal in
minicart.phtml; the widget used to display a summary of the shopping cart in the top-right corner of the page. In particular cases, we want to display the Grand Total, which is the sum of all the items added to the shopping cart including taxes (VAT).
|// Get Price of all Items in Cart including VAT/Tax|
The Wait is Over.
Get the Newsletter you've always wanted, now!
No spam. I promise.
Get Total Price excluding/without VAT/Tax
If your clientele consists of businesses you might want to change the way your theme displays its totals in the mini-cart. The code below can be used to display or manipulate the Subtotal; which is the sum of all the items added to the cart excluding taxes (VAT).
|// Get Total Price excluding/without VAT/Tax|
I hope this was helpful. Have you found a more efficient way to handle the above, or do you just want to say ‘Thank you’? Feel free to leave a comment!