VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Pejo on September 24, 2013, 03:27:16 AM

Title: Edit order mail table
Post by: Pejo on September 24, 2013, 03:27:16 AM
Hi,

Can you tell me please where can I edit table received in order e-mail?
As you can see in my attachment image, my currency symbol is out of line, also, payment price is not in line like other prices.

If it is possible just to resize whole box for 20px or maybe 10%?
Thanks.

[attachment cleanup by admin]
Title: Re: Edit order mail table
Post by: Pejo on September 25, 2013, 19:11:27 PM
I have look at some .php files and in components/com_virtuemart/views/invoice/tmpl/invoice_items.php i found lines of those prices and taxes, and I so that there is aligment "right". I have try to change to "left" but then is worse.

Any idea?
Title: Re: Edit order mail table
Post by: PRO on September 25, 2013, 19:53:59 PM
for the "width"
look here at the header percentage widths for each column.
<table class="html-email" width="100%" cellspacing="0" cellpadding="0" border="0">
   <tr align="left" class="sectiontableheader">
      <td align="left" width="5%"><strong><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_SKU') ?></strong></td>
      <td align="left" colspan="2" width="38%" ><strong><?php echo JText::_('COM_VIRTUEMART_PRODUCT_NAME_TITLE') ?></strong></td>
      <td align="center" width="10%"><strong><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_PRODUCT_STATUS') ?></strong></td>
      <?php if ($this->doctype == 'invoice') { ?>
      <td align="right" width="10%" ><strong><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_PRICE') ?></strong></td>
      <?php } ?>
      <td align="right" width="6%"><strong><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_QTY') ?></strong></td>
      <?php if ($this->doctype == 'invoice') { ?>
      <?php if ( VmConfig::get('show_tax')) { ?>
      <td align="right" width="10%" ><strong><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_PRODUCT_TAX') ?></strong></td>
        <?php } ?>
      <td align="right" width="11%"><strong><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_SUBTOTAL_DISCOUNT_AMOUNT') ?></strong></td>
      <td align="right" width="11%"><strong><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_TOTAL') ?></strong></td>
      <?php } ?>
   </tr>


You can change the others smaller, and make that 1 larger.
OR: 1st, make sure they all equal 100%

for the last, out of line problem.
You need to reduce the "colspan"   of the TD right before it

Like if it is
<td align="left" colspan="4" >

change the 4 to 3
Title: Re: Edit order mail table
Post by: Pejo on September 25, 2013, 20:01:02 PM
Thank you so much for answer. I will try now and check out later here to confirm my results.
Thanks again. ;)
Title: Re: Edit order mail table
Post by: Pejo on September 25, 2013, 21:48:11 PM
OK, everything works great, it is like you said. THANKS.
But, here is one small thing:

As you can see, I remove some of items I do not need, for example "status", because, status is already in mail above (in header), also status of ordered will be in mail subject, and I got some more space and more percent for other tables.

Everything works great, also I reorder some of this items (for example, name of product is first, SKU is second, number of items third, etc.). I like it this way, thanks.

Now, thing that doesn't work is "colspan". As you can see in attached image, when I insert one number less (from 4 to 3), numbers goes in tabs where they have to be in first place, but now text is out of order.

I was looking in .php script for 'shipmentName' and for this 'paymentName' and code is exactly the same. I do not understand why for 'shipmentName' everything is good, but under it for 'paymentName' is out of table.

I am thanking you in advance for solving this.  ;D

[attachment cleanup by admin]
Title: Re: Edit order mail table
Post by: PRO on September 25, 2013, 22:06:59 PM
not all colspans will be the same,
for example, payments can have discounts.

so it could be from that column,.
Title: Re: Edit order mail table
Post by: Pejo on September 25, 2013, 22:44:31 PM
I know, but this one 'paymentName', is really out of order, I mean out of line.
When I insert some value, then tax is in line of discount, as you can see before I have translate it and change any in line in invoice_items.php

(look at attachment).

So, if I replace colspan from 4 to 3, then tax and total are in good columns, but text is out of order.
I am not so good in .php, but as I can see, all tables are made in invoice_items.php, right?

I know what you mean that payments can have discounts, but if this kind of payment would have discount, this discount would be show under total, not under discount.

It seems like there is one table row between text and tax. Do I need to find .php where payment is configured?
Maybe there I need to reorder or remove this blank field between text and tax.

Anyway, sorry for trouble and thanks for help.

[attachment cleanup by admin]
Title: Re: Edit order mail table
Post by: Pejo on September 25, 2013, 22:49:04 PM
I just tried something. I have copied 'shipmentName' whole code and replaced 'paymentName'. Now everything is in order, so that means that I have to look somewhere else to delete this blank field, or reorder, maybe this blank field is discount in front of tax or otherwise.
Title: Re: Edit order mail table
Post by: Pejo on September 26, 2013, 20:52:11 PM
Noup. I can not find why is this out of table. I have no idea... :(

EDIT: My sincerely apologize. Forgot to say about my JM and VM versions:

Joomla 2.5.4 - VM 2.0.6

Problem is, I can not upgrade Joomla or VM, because it is connected (this is bought theme, and it is connected one with other). I tried to upgrade, but then nothing works anymore. Everything is messed up after upgrade, so I work with what I have at the moment... ;)
Title: Re: Edit order mail table
Post by: PRO on September 27, 2013, 02:59:18 AM
have you looked at it with firebug? to see whats going on?
Title: Re: Edit order mail table
Post by: Pejo on September 27, 2013, 16:15:52 PM
No, I have mac and I use Safari. I am going to download Firefox and try with Firebug. Thanks.

EDIT:

I have just figure it out I can not use firebug in mail, or in invoice.items.php to see whats going on :(
Can not figure it out what it is. Same code, same everything, but different layout.

Maybe someone here can see in this code what to remove or to add, but as I said, if I replace first row "shipmentName" with second row "paymentName", I get everything in order.
Is there somewhere else where this table is created, or maybe where all of this is calculated?

<tr>
<td align="right" class="pricePad" colspan="5"><?php echo $this->orderDetails['shipmentName'?></td>


<?php if ( VmConfig::get('show_tax')) { ?>
<td align="right"><?php echo "<span  class='priceColor2'>".$this->currency->priceDisplay($this->orderDetails['details']['BT']->order_shipment_tax)."</span>" ?></td>
                                <?php ?>
<td align="right"></td>
<td align="right"><?php echo $this->currency->priceDisplay($this->orderDetails['details']['BT']->order_shipment$this->orderDetails['details']['BT']->order_shipment_tax); ?></td>

</tr>

<tr>
<td align="right" class="pricePad" colspan="5"><?php echo $this->orderDetails['paymentName']  ?><td>

<?php if ( VmConfig::get('show_tax')) { ?>
<td align="right"><?php echo "<span  class='priceColor2'>".$this->currency->priceDisplay($this->orderDetails['details']['BT']->order_payment_tax)."</span>" ?></td>
                                <?php ?>
<td align="right"></td>
<td align="right"><?php echo $this->currency->priceDisplay($this->orderDetails['details']['BT']->order_payment$this->orderDetails['details']['BT']->order_payment_tax); ?></td>


</tr>
Title: Re: Edit order mail table
Post by: Maxim Pishnyak on September 30, 2013, 06:59:20 AM
Quote from: Pejo on September 26, 2013, 20:52:11 PM
Joomla 2.5.4 - VM 2.0.6

Problem is, I can not upgrade Joomla or VM, because it is connected (this is bought theme, and it is connected one with other). I tried to upgrade, but then nothing works anymore. Everything is messed up after upgrade, so I work with what I have at the moment... ;)[/b]
http://forum.virtuemart.net/index.php?topic=107928.msg405017#msg405017
Title: Re: Edit order mail table
Post by: PRO on October 01, 2013, 17:42:44 PM

change the style of the table to have borders on the cells, and you can see better
Title: Re: Edit order mail table
Post by: Pejo on October 01, 2013, 21:27:00 PM
Quote from: PRO on October 01, 2013, 17:42:44 PM

change the style of the table to have borders on the cells, and you can see better

Sorry, I didn't quite understand. To insert border, where?
Title: Re: Edit order mail table
Post by: PRO on October 03, 2013, 15:55:46 PM
http://www.w3schools.com/css/css_table.asp


the table TDs
Title: Re: Edit order mail table
Post by: Pejo on October 05, 2013, 18:08:55 PM
@PRO. thanks for your help. I gave up. Can not find it and I will leave this way, or delete it completely fro invoice mail. After 10 days I am to frustrated to carry on. Thanks anyway.
Title: Re: Edit order mail table
Post by: Pejo on October 05, 2013, 18:57:21 PM
 ;D ;D ;D

FOUND ERROR!!

One of the table wasn't closed, so it makes space. One of (td) wasn't closed. :)

This is the wrong code:

<td align="right" class="pricePad" colspan="5"><?php echo $this->orderDetails['paymentName']  ?><td>

<?php if ( VmConfig::get('show_tax')) { ?>
<td align="right"><?php echo "<span  class='priceColor2'>".$this->currency->priceDisplay($this->orderDetails['details']['BT']->order_payment_tax)."</span>" ?></td>


So after 'paymentName' table wasn't closed, that what makes that space. I was looking from code to code, starting from scratch again and I noticed that here is bug :D
Anyway, thank you for helping me... ;)

[attachment cleanup by admin]