mod cart want the totalprice ex tax, in stead of incl. tax

Started by Newllander, April 06, 2015, 16:23:16 PM

Previous topic - Next topic

Newllander

I want the cart to display the total price excluding tax, in stead of incl. tax.

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

I tried for example:
<div class="total">
<?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?

Newllander

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
// 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:
<div class="gkTotal"> <?php echo str_replace(JText::_('COM_VIRTUEMART_CART_TOTAL'), ''$data->billTotal_net); ?> </div>

It also works this way with the default vmcart. Just make an override and change the $data->billTotal to $data->billTotal_net.

That works like a charm. See: http://www.vdmkantoormeubelen.nl/