cart total incl. tax, but want it excl. tax

Rate this topic: Evaluations: 1, 6.00 on the average.Evaluations: 1, 6.00 on the average.Evaluations: 1, 6.00 on the average.Evaluations: 1, 6.00 on the average.Evaluations: 1, 6.00 on the average.Evaluations: 1, 6.00 on the average.6.00 out of 6 based on 1 vote(s)
GK User
Mon Apr 06, 2015 3:37 pm
Reply with quote
Report this post
I want the cart to display the total price excluding tax, in stead of incl. tax.

It's now like:
Code: Select all
<div class="gkTotal"> <?php echo str_replace(JText::_('COM_VIRTUEMART_CART_TOTAL'), '', $data->billTotal); ?> </div>


I tried for example:
Code: Select all
<div class="gkTotal">
<?php
$taxCoEf = 1.21;
$totalInTax = $data->billTotal;
$totalExTax = $totalInTax / $taxCoEf;
echo str_replace(JText::_('COM_VIRTUEMART_CART_TOTAL'), '', $totalExTax);
?>
</div>


I'm pretty noob with php, but do my best. This gives a '0' as result. What can I do else?
User avatar
Fresh Boarder

GK User
Mon Apr 06, 2015 4:44 pm
Reply with quote
Report this post
As patient as I am, I figured it out myself. :woohoo:
I needed to add an extra line to /components/com_virtuemart/helpers/cart.php
After line 1675
Code: Select all
// ex tax is what we want as well
$data->billTotal_net = $currencyDisplay->priceDisplay( $this->cartPrices['discountedPriceWithoutTax'] );


I changed the code on line 98 in /templates/gk_instyle/html/mod_virtuemart_cart/default.php to:
Code: Select all
<div class="gkTotal"> <?php echo str_replace(JText::_('COM_VIRTUEMART_CART_TOTAL'), '', $data->billTotal_net); ?> </div>


That works like a charm. See: http://www.vdmkantoormeubelen.nl/
User avatar
Fresh Boarder


cron