News:

Looking for documentation? Take a look on our wiki

Main Menu

Remove "discount" column from email

Started by naoko15, January 22, 2014, 13:59:17 PM

Previous topic - Next topic

naoko15

Hello, i'd like to know how can i remove the discount column from the order confirmation email. I've looked everywhere in the forum but can't find the information. Thanks.

I'm using J2.5, VM 2.0.20b

[attachment cleanup by admin]

jenkinhill

First be aware that all VM versions before 2.0.22c have known security issues - and some earlier versions have been hacked. http://forum.virtuemart.net/index.php?topic=118683.0

The following applies the the current version 2.0.26d but may also be applicable to earlier versions. The following is not tested and may require some additional edits. The edit will be included in the invoice as well as the email, they cannot be separated.

Edit the file components/com_virtuemart/views/invoice/tmpl/invoice_items.php  and remove the following <td> elements:


<td align="right" width="11%"><strong><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_SUBTOTAL_DISCOUNT_AMOUNT'?></strong></td>



<td align="right" class="priceCol" >
<?php echo  $this->currency->priceDisplay$item->product_subtotal_discount$this->currency );  //No quantity is already stored with it ?>
</td>



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



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


Use the edited file as a template override.  See http://docs.virtuemart.net/tutorials/33-templating-layouts.html and http://www.ostraining.com/blog/joomla/overrides

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

naoko15

Thank you alot, it works great, but how can i get the line "precio total" (total price) to be aligned with the  "total" column and remove the last "0,00" in the final line?

Thanks again.

[attachment cleanup by admin]

jenkinhill

You will have to look carefully at the table structure to work it out.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

anifb03

Hy!

I have the same problem...I did what you said but it didn't working :(
Can you please tell me what i have to do...maybe i need to modify the code from other file

Thank you and have a great day!

lanthan

#5
You just have to uncomment/delete all <td></td> before the last <td> of every row and decrease the colspan.

invoice_items.php
line 22 $colspan=8; --> change to $colspan=7;

line 43       <td align="right" width="11%"><strong><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_SUBTOTAL_DISCOUNT_AMOUNT') ?></strong></td>
line 94-96  <td align="right" class="priceCol" ><?php echo  $this->currency->priceDisplay( $item->product_subtotal_discount, $this->currency );  //No quantity is already stored with it ?></td>
line 124     <td align="right"><?php echo "<span  class='priceColor2'>".$this->currency->priceDisplay($this->orderDetails['details']['BT']->order_discountAmount, $this->currency)."</span>" ?></td>
line 136     <td align="right"></td>
line 151     <td align="right"> <?php echo  $this->currency->priceDisplay($rule->calc_amount, $this->currency);  ?></td>
line 161     <td align="right"><?php    ?> </td>
line 171     <td align="right"><?php  echo   $this->currency->priceDisplay($rule->calc_amount, $this->currency);  ?> </td>
line 198     <td align="right"></td>
line 208     <td align="right"><span class='priceColor2'><?php echo $this->currency->priceDisplay($this->orderDetails['details']['BT']->order_billDiscountAmount, $this->currency); ?></span></td>

Hope this are the right lines, didnĀ“t check ;-)

anifb03

Thank you Lanthan for the response but it didn't working:(
I've tried everything, including deleting the folder invoice from the com_virtuemart/views but nothing happened


lanthan

#7
../templates/your_template/html/com_virtuemart/invoice/invoice_items.php

Type "test" before line 29

?>
test
<table class="html-email" ....

and check, if this word appears on your e-mail. If not, you are editing the wrong file.

Do you use a 3rd party template?