News:

Support the VirtueMart project and become a member

Main Menu

[PARTIALLY SOLVED WITH WORKAROUND] Edit template email order

Started by jack19, September 11, 2012, 18:30:54 PM

Previous topic - Next topic

jack19

Hi,
I searched the forum but could not find anything.
I would like to see the mail order in this way, but I do not know which file to edit.
Moreover, one can manage the space between shipment name and shipment description and between payment name and payment description.
See attached image.

[attachment cleanup by admin]
Best regards

Joomla! 2.5.9
Virtuemart 2.0.18a

jack19

Hi,
I fixed almost everything.
the only thing that can not be solved is that of obtaining the space between the words:

TelematicaConsegna di prodotti virtuali
Bonifico Bancario AnticipatoBonifico Bancario

should be so

Telematica Consegna di prodotti virtuali
Bonifico Bancario Anticipato Bonifico Bancario

where
Telematica=shipment_name
Consegna di prodotti virtuali=shipment_desc

and
Bonifico Bancario Anticipato=payment_name
Bonifico Bancario=payment_desc

:'( :'( :-\
Best regards

Joomla! 2.5.9
Virtuemart 2.0.18a

jack19

Hi,
I noticed a different behavior when displaying html.
In the mail client Outlook 2010, many CSS styles are not applied, while in the browser view yes (by the function present in Outlook).
To space the words I used in the file mail_html.php that class:. vmpayment_description,. vmshipment_description {color: gray; font-size: 9px; padding: 0 2px; margin-left: 2px;}
I also added in the same file declarations:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it-it" lang="it-it" dir="ltr">
    <head>
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />

Why is this different behavior?
I post the full HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it-it" lang="it-it" dir="ltr">
    <head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

<style type="text/css">
            body, td, span, p, th {
background:  #f2f2f2;
font-family:Verdana, Geneva, sans-serif;
font-size:12px;
color: #036;
}
    table.html-email {margin:10px auto;
background:#f2f2f2;
border:dotted #dad8d8 1px;
border-radius:8px;
-webkit-border-radius:8px;
-moz-border-radius:8px;
}
    .html-email tr{border-bottom : 1px solid #eee;}
    span.grey {color:#666;}
    span.date {color:#666; }
    a.default:link, a.default:hover, a.default:visited {
color:#666;line-height:25px;
background: #f2f2f2;
margin: 10px ;
padding: 3px 8px 1px 8px;
border: solid #036 1px;
border-radius:8px;
-webkit-border-radius:8px;
-moz-border-radius:8px;
text-shadow: 1px 1px 1px #f2f2f2;
font-size: 12px;
background-position: 0px 0px;
display: inline-block;
text-decoration: none;
}
    a.default:hover {color:#fff;background: #5BADFF;}
    .cart-summary{ }
    .html-email th { background: #ccc;margin: 0px;padding: 10px;}
    .sectiontableentry2, .html-email th, .cart-summary th{ background: #ccc;margin: 0px;padding: 10px;}
    .sectiontableentry1, .html-email td, .cart-summary td {background: #fff;margin: 0px;padding: 10px;}
    .line-through{text-decoration:line-through;}
.right {margin-left: 180px;}
.vmpayment_name, .vmpayment_cost, .vmshipment_name, .vmshipment_cost{padding:0 2px;}
                             .vmpayment_description, .vmshipment_description {color:gray;font-size:9px;padding:0 2px; margin-left:2px;}

</style>

    </head>

    <!-- body style="background: #F2F2F2;word-wrap: break-word;" -->
      <body style="word-wrap: break-word;">
<div style="background-color: #e6e6e6;" width="100%">
    <table style="margin: auto;" cellpadding="0" cellspacing="0" width="700" ><tr><td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="html-email">
<tr>
<td align="top">
<img src="http://localhost/test/images/stories/virtuemart/vendor/test_2012.png" />
</td>
<td><div class="right">
TESTING Srl.<br />Sig. Gioacchino Cipriano<br />Via delle Marmotte, 1/10<br />20120 Milano<br />Italy<br />Milano<br />+39 02987654321<br />            </div>
</td>
</tr>
<tr>
<td colspan="2">
<strong>Salve Sig. Superman,</strong><br/>
</td>
</tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="html-email">

  <tr>
    <td width="30%">
Numero d'ordine: <br />
<strong>af90068</strong>

</td>
    <td width="30%">
la password del suo ordine è: <br />
<strong>p_38fed</strong>
</td>
    <td width="40%">
    <p>
<a class="default" title="TESTING" href="http://localhost/test/index.php?option=com_virtuemart&view=orders&layout=details&order_number=af90068&order_pass=p_38fed">
Visualizzate il vostro ordine online</a>
</p>
</td>
  </tr>
  <tr>
    <td colspan="3"><p>
<p><b>Il totale del vostro ordine è: 40,00 €</b></p></p></td>
  </tr>
  <td colspan="3"><p>
Lo stato dell'ordine è In attesa</p></td>
  </tr>
    </table>
<table class="html-email" cellspacing="0" cellpadding="0" border="0" width="100%">  <tr  >
<th width="50%">
    Dati di fatturazione </th>
<th width="50%" >
    Indirizzo di spedizione </th>
    </tr>
    <tr>
<td valign="top" width="50%">

    <!-- span class="titles">Nome Azienda</span -->
        <span class="values vm2-company" >TESTING 2</span>
    <br class="clear" />
    <!-- span class="titles">E-Mail</span -->
        <span class="values vm2-email" >testing@test.it</span>
    <br class="clear" />
    <!-- span class="titles">Titolo</span -->
        <span class="values vm2-title" >Sig.</span>
<!-- span class="titles">Nome</span -->
        <span class="values vm2-first_name" >Nembo</span>
<!-- span class="titles">Cognome</span -->
        <span class="values vm2-last_name" >Kid</span>
    <br class="clear" />
    <!-- span class="titles">Indirizzo 1</span -->
        <span class="values vm2-address_1" >Via delle Marmotte, 1/10</span>
    <br class="clear" />
    <!-- span class="titles">CAP</span -->
        <span class="values vm2-zip" >20120</span>
<!-- span class="titles">Città</span -->
        <span class="values vm2-city" >Milano</span>
    <br class="clear" />
    <!-- span class="titles">Nazione</span -->
        <span class="values vm2-virtuemart_country_id" >Italy</span>
    <br class="clear" />
    <!-- span class="titles">Stato / Provincia / Regione</span -->
        <span class="values vm2-virtuemart_state_id" >Milano</span>
    <br class="clear" />
    <!-- span class="titles">Telefono</span -->
        <span class="values vm2-phone_1" >02323456789</span>
    <br class="clear" />
   
</td>
<td valign="top" width="50%">
    <!-- span class="titles">Nome Azienda</span -->
    <span class="values vm2-company" >TESTING</span>
            <br class="clear" />
<!-- span class="titles">Nome</span -->
    <span class="values vm2-first_name" >Nembo</span>
    <!-- span class="titles">Cognome</span -->
    <span class="values vm2-last_name" >Kid</span>
            <br class="clear" />
<!-- span class="titles">Indirizzo 1</span -->
    <span class="values vm2-address_1" >Via delle Marmotte, 1/10</span>
            <br class="clear" />
<!-- span class="titles">CAP</span -->
    <span class="values vm2-zip" >20120</span>
    <!-- span class="titles">Città</span -->
    <span class="values vm2-city" >Milano</span>
            <br class="clear" />
<!-- span class="titles">Nazione</span -->
    <span class="values vm2-virtuemart_country_id" >Italy</span>
            <br class="clear" />
<!-- span class="titles">Stato / Provincia / Regione</span -->
    <span class="values vm2-virtuemart_state_id" >Milano</span>
            <br class="clear" />
<!-- span class="titles">Telefono</span -->
    <span class="values vm2-phone_1" >02323654654</span>
            <br class="clear" />
</td>
    </tr>
</table>

<table class="html-email" width="100%" cellspacing="0" cellpadding="0" border="0">
<!-- tr align="left" class="sectiontableheader">
<td align="left" width="5%"><strong>Codice SKU</strong></td>
<td align="left" colspan="2" width="38%" ><strong>Nome prodotto</strong></td>
<td align="center" width="10%"><strong>Stato</strong></td>
<td align="right" width="10%" ><strong>Prezzo</strong></td>
<td align="right" width="6%"><strong>Q.tà</strong></td>
<td align="right" width="10%" ><strong>IVA/Tasse</strong></td>
  <td align="right" width="11%"><strong>Sconto</strong></td>
<td align="right" width="11%"><strong>Totale</strong></td>
</tr -->
<tr align="left" class="sectiontableheader">
<td align="left" width="8%"><strong>Codice SKU</strong></td>
<td align="left" colspan="2" width="19%" ><strong>Nome prodotto</strong></td>
<td align="center" width="10%"><strong>Stato</strong></td>
<td align="right" width="11%" ><strong>Prezzo</strong></td>
<td align="right" width="3%"><strong>Q.tà</strong></td>
<td align="right" width="10%" ><strong>IVA/Tasse</strong></td>
  <td align="right" width="8%"><strong>Sconto</strong></td>
<td align="right" width="12%"><strong>Totale</strong></td>
</tr>

<tr valign="top">
<td align="left">
HOS001 </td>
<td align="left" colspan="2" >
<a href="http://localhost/test/index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=1&virtuemart_product_id=2">Hosting 001</a>
</td>
<td align="center">
In attesa </td>
<td align="right"   class="priceCol" >
    <span >33,06 €</span><br /> </td>
<td align="right" >
1 </td>
             <td align="right" class="priceCol"><span  class='priceColor2'>6,94 €</span></td>
                                <td align="right" class="priceCol" >
0,00 € </td>
<td align="right"  class="priceCol">
40,00 € </td>
</tr>

<tr><td colspan="7"></td></tr>
<tr class="sectiontableentry1">
<td colspan="6" align="right">Prezzo totale prodotto</td>

                        <td align="right"><span  class='priceColor2'>6,94 €</span></td>
                        <td align="right"><span  class='priceColor2'>0,00 €</span></td>
<td align="right">40,00 €</td>
  </tr>




<tr>
<td align="left" class="pricePad" colspan="6"><span class="vmshipment_name">Telematica</span><span class="vmshipment_description">Consegna di prodotti virtuali</span></td>

<td align="right"><span class='priceColor2'>0,00 €</span> </td>
<td align="right"></td>
<td align="right">0,00 €</td>
</tr>

<tr>
<td align="left" class="pricePad" colspan="6"><span class="vmpayment_name">Bonifico Bancario Anticipato</span><span class="vmpayment_description">Bonifico Bancario</span><br />Gentile cliente potete disporre il Bonifico Bancario
utilizzando le seguenti coordinate:

Benificiario TESTING Srl
IBAN PIPPOCC123456789877</td>

<td align="right"><span class='priceColor2'>0,00 €</span> </td>
<td align="right"></td>
<td align="right">0,00 €</td>
</tr>

<tr>
<td align="right" class="pricePad" colspan="6"><strong>Totale</strong></td>

<td align="right"><span class='priceColor2'>6,94 €</span></td>
<td align="right"><span class='priceColor2'>0,00 €</span></td>
<td align="right"><strong>40,00 €</strong></td>
</tr>

</table>

<br/><br/>Vi ringraziamo per l'acquisto presso <a href="http://localhost/test/index.php?option=com_virtuemart">Testing Srl</a><br/>Testing Srl<br /> Test<br /> <br />     </td></tr>
    </table>
</div>
    </body>
</html>


Best regards
Gioacchino
Best regards

Joomla! 2.5.9
Virtuemart 2.0.18a

jack19

Hi,
nothing to do.
display in mail client is very bad. Gmail also the result is bad.
:-[ :'(
Best regards

Joomla! 2.5.9
Virtuemart 2.0.18a

ivus

Hi jack19,

HTML formatted emails are still somewhat restrictive.

Here is an amazingly awesome article about formatting HTML emails.
http://htmlemailboilerplate.com/
includes downloadable base templates

jack19

Quote from: ivus on September 13, 2012, 17:27:59 PM
Hi jack19,

HTML formatted emails are still somewhat restrictive.

Here is an amazingly awesome article about formatting HTML emails.
http://htmlemailboilerplate.com/
includes downloadable base templates
Hi ivus,
Thank you for reply.
I watch and then tell you
Best regards

Joomla! 2.5.9
Virtuemart 2.0.18a

jack19

Quote from: ivus on September 13, 2012, 17:27:59 PM
Hi jack19,

HTML formatted emails are still somewhat restrictive.

Here is an amazingly awesome article about formatting HTML emails.
http://htmlemailboilerplate.com/
includes downloadable base templates
Hi ivus,
I resolved quite well with your suggestions.
Only one thing I can not solve.
Around line 167 of file invoice_items.php I have this code
<td align="left" class="pricePad" colspan="6"><?php echo $this->orderDetails['shipmentName'?></td>
which returns the following output:
td align="left" class="pricePad" colspan="6"><span class="vmshipment_name">Shipment Name</span><span class="vmshipment_description">Shipment Description</span></td>
but appears
Shipment NameShipment Description (without separation between the two).
instead of
Shipment Name Shipment Description
in the css I gave these instructions but nothing changes
.vmpayment_description, .vmshipment_description {
color:gray;
font-size:9px;
padding:0 2px;
margin-left:2px !important;

Why?
  :'( :'( :'( :'( :'( :'(
Best regards

Joomla! 2.5.9
Virtuemart 2.0.18a

jack19

Hi,
I created this workaround:
<td align="left" class="pricePad" colspan="6"><?php $shipmentNewName str_replace("span","div",$this->orderDetails['shipmentName']); echo $shipmentNewName?></td>
and
<td align="left" class="pricePad" colspan="6"><?php $paymentNewName str_replace("span","div",$this->orderDetails['paymentName']); echo $paymentNewName?></td>
not great, but at least separates the name from the description.
Best regards

Joomla! 2.5.9
Virtuemart 2.0.18a

ivus

did you try setting the following style



.vmpayment_description, .vmshipment_description {
display:block;
color:gray;
font-size:9px;
padding:0 2px;
margin-left:2px !important;


jack19

Quote from: ivus on September 20, 2012, 05:47:56 AM
did you try setting the following style



.vmpayment_description, .vmshipment_description {
display:block;
color:gray;
font-size:9px;
padding:0 2px;
margin-left:2px !important;



Hi ivus,
unfortunately I have already tried these attempts with CSS, but no solution.
The only way at the moment is my workaround.
I think the problem is in this code

echo $this->orderDetails['paymentName']

which brings together the two values ​​(name and description) and I could not find on any page, in addition to a misinterpretation of the CSS element span. :-[
Best regards

Joomla! 2.5.9
Virtuemart 2.0.18a

lipes

Order Emails are terrible ...

which file could we change the "Costumer Name" field and give in that space a <br /> to next field "Address" ?

Otherway we'll continue to have a layout like this:
"John Street 12"
vs
"John
Street 12"
VM V. online: J2.5.14 | VM 2.0.20a | SQL 5.1.70 | PHP 5.3.25

PRO

mail_html_shopperaddrress

ITS THERE

foreach ($this->userfields['fields'] as $field) {
      if (!empty($field['value'])) {
         ?><!-- span class="titles"><?php echo $field['title'] ?></span -->
              <span class="values vm2<?php echo '-' . $field['name'] ?>" ><?php echo $this->escape($field['value']) ?></span>
         <?php if ($field['name'] != 'title' and $field['name'] != 'first_name' and $field['name'] != 'middle_name' and $field['name'] != 'zip') { ?>
             <br class="clear" />



lipes

but from what i see is that we cant separate the Costumer name from the address.. or we can do?
VM V. online: J2.5.14 | VM 2.0.20a | SQL 5.1.70 | PHP 5.3.25

jack19

Quote from: lipes on October 18, 2012, 15:45:02 PM
Order Emails are terrible ...

which file could we change the "Costumer Name" field and give in that space a <br /> to next field "Address" ?

Otherway we'll continue to have a layout like this:
"John Street 12"
vs
"John
Street 12"
Hi lipes,
I do not have the problem that you reported.
But only in shipmentName and paymentName.
Rgds.
Best regards

Joomla! 2.5.9
Virtuemart 2.0.18a