You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

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


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">
$totalInTax $data->billTotal;
$totalExTax $totalInTax $taxCoEf;
str_replace(JText::_('COM_VIRTUEMART_CART_TOTAL'), ''$totalExTax); 


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


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: