VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: mediax on March 23, 2016, 08:11:27 AM

Title: Display Subtotal Without tax
Post by: mediax on March 23, 2016, 08:11:27 AM
Hi Guys,

I am trying to display a subtotal without tax in my invoice. This is the code that is used in invoice_items.php

<?php echo $this->currency->priceDisplay($this->orderDetails['details']['BT']->order_salesPrice, $this->currency) ; ?>

This gives me the total with tax and although I have looked I cannot find a way to display this without tax.

Any help would be great :)

MediaX
Title: Re: Display Subtotal Without tax
Post by: AH on March 23, 2016, 11:42:05 AM
The subtotal_net is not a variable passed to the invoice items code - so you have to create one for yourself.

Here is what I use - it might work for you


<!-- Totals line   -->
<tr class="cart-totals">
<td align="right" class="pricePad" colspan="4"><strong><?php echo vmText::_('COM_VIRTUEMART_ORDER_PRINT_TOTAL'?></strong></td>

<?php if ( VmConfig::get('show_tax')) {
            
$billNet $this->orderDetails['details']['BT']->order_total $this->orderDetails['details']['BT']->order_billTaxAmount;
            
?>


<td align="right"><span class='priceColor2'><?php echo $this->currency->priceDisplay($this->orderDetails['details']['BT']->order_billTaxAmount$this->currency); ?></span></td>
        <td align="right"><span class='priceColor2'><?php echo $this->currency->priceDisplay($billNet$this->currency); ?></span></td>
<?php ?>

<td align="right"><strong><?php echo $this->currency->priceDisplay($this->orderDetails['details']['BT']->order_total$this->currency); ?></strong></td>
</tr>
<!--End of totals-->

Title: Re: Display Subtotal Without tax
Post by: mediax on March 23, 2016, 13:33:49 PM
Thanks for the reply, that will work perfectly.

Title: Re: Display Subtotal Without tax
Post by: AH on March 23, 2016, 14:21:28 PM
 :)