VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: naoko15 on January 22, 2014, 13:59:17 PM

Title: Remove "discount" column from email
Post by: naoko15 on January 22, 2014, 13:59:17 PM
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]
Title: Re: Remove "discount" column from email
Post by: jenkinhill on January 22, 2014, 21:49:04 PM
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

Title: Re: Remove "discount" column from email
Post by: naoko15 on January 23, 2014, 13:57:27 PM
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]
Title: Re: Remove "discount" column from email
Post by: jenkinhill on January 23, 2014, 17:33:47 PM
You will have to look carefully at the table structure to work it out.
Title: Re: Remove "discount" column from email
Post by: anifb03 on June 28, 2014, 13:43:17 PM
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!
Title: Re: Remove "discount" column from email
Post by: lanthan on June 29, 2014, 13:45:09 PM
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 ;-)
Title: Re: Remove "discount" column from email
Post by: anifb03 on June 29, 2014, 14:27:27 PM
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

Title: Re: Remove "discount" column from email
Post by: lanthan on June 29, 2014, 14:30:50 PM
../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?