VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: Beni on September 03, 2014, 20:10:53 PM

Title: Can I display unit price with tax in email?
Post by: Beni on September 03, 2014, 20:10:53 PM
Dear Members,

Can I display products unit price with TAX in order confirmation email? If yes, please write the solution... Thank you!

I think i must to change this section in templates/xxx/html/com_virtuemart/invoice/invoice_items.php

<?php if ($this->doctype == 'invoice') { ?>
         <td align="center"   class="priceCol" style="border: solid 1px #6C6C6C;padding: 4px;font-size:14px; vertical-align: middle; display: table-cell;">
            <?php
            $item->product_discountedPriceWithoutTax = (float) $item->product_discountedPriceWithoutTax;
            if (!empty($item->product_priceWithoutTax) && $item->product_discountedPriceWithoutTax != $item->product_priceWithoutTax) {
               echo '<span class="line-through">'.$this->currency->priceDisplay($item->product_item_price, $this->currency) .'</span><br />';
               echo '<span >'.$this->currency->priceDisplay($item->product_discountedPriceWithTax, $this->currency) .'</span><br />';
            } else {
               echo '<span >'.$this->currency->priceDisplay($item->product_item_price, $this->currency) .'</span><br />';
            }
            ?>
         </td>
      <?php } ?>

Although I don't know the PHP, so I cant change this...
I use VM 2.6.8b

Beni
Title: Re: Can I display unit price with tax in email?
Post by: GJC Web Design on September 03, 2014, 22:11:12 PM
you need to echo out your $item object to find what price you want then use it instead of $item->product_item_price

print 'Debug Line '.__LINE__.' $item <pre>'; print_r ($item); print "</pre><br />\n";
Title: Re: Can I display unit price with tax in email?
Post by: Beni on September 04, 2014, 07:43:17 AM
Thank you, but I don't know PHP...  But I solved my problem (not nice, but working  ;))

echo '<span >'.$this->currency->priceDisplay($item->product_item_price*127/100, $this->currency) .'</span><br />';     (our tax is 27%)

Beni