News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

E-mail templates

Started by LuukDriessen, January 25, 2013, 11:32:56 AM

Previous topic - Next topic

LuukDriessen

People,

I have, like many users, some problems with the order e-mails.
I know that the css stylesheet isn't taken by gmail. Therefore, we need to change the css to inline css stylesheet. Unfortunately I can't get it work. Is there someone that have already made this customization?


Also, I'm having a problem in the e-mail that the customer receivs. See the attachment.
Ofcourse I changed invoice_items.php and make the columns bigger. <td align="left" width="16%">

Is there someone who see my mistake in the code? Because I've the latest version of Joomla and Virtuemart and the error should be gone.

Joomla 2.5.8 and Virtuemart 2.0.18a

Thanks in advance

gr Luuk



mail_html.php

<?php
/**
*
* Order items view
*
* @package VirtueMart
* @subpackage Orders
* @author Max Milbers, Valerie Isaksen
* @link http://www.virtuemart.net
* @copyleft Copyleft (c) 2004 - 2010 VirtueMart Team. All lefts reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* @version $Id: details_items.php 5432 2012-02-14 02:20:35Z Milbo $
*/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

 if ( 
VmConfig::get('show_tax')) {
    
$colspan=7;
 } else {
    
$colspan=8;
 }
?>

<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="28%" ><strong><?php echo JText::_('COM_VIRTUEMART_PRODUCT_NAME_TITLE'?></strong></td>
<td align="left" width="1%">&nbsp;</td>
<td align="left" width="15%" ><strong><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_PRICE'?></strong></td>
<td align="left" width="7%"><strong><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_QTY'?></strong></td>
<?php if ( VmConfig::get('show_tax')) { ?>
<td align="left" width="20%" ><strong><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_PRODUCT_TAX'?></strong></td>
  <?php ?>
<td align="left" width="10%"><strong><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_SUBTOTAL_DISCOUNT_AMOUNT'?></strong></td>
<td align="left" width="35%"><strong><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_TOTAL'?></strong></td>
</tr>
    <tr><td>&nbsp;</td></tr>

<?php
foreach(
$this->orderDetails['items'] as $item) {
$qtt $item->product_quantity ;
$product_link JURI::root().'index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=' $item->virtuemart_category_id .
'&virtuemart_product_id=' $item->virtuemart_product_id;

?>

<tr valign="top">
<td align="left">
<?php echo $item->order_item_sku?>
</td>
<td align="left" colspan="2" >
<a href="<?php echo $product_link?>"><?php echo $item->order_item_name?></a>
<?php
//  vmdebug('$item',$item);
if (!empty($item->product_attribute)) {
if(!class_exists('VirtueMartModelCustomfields'))require(JPATH_VM_ADMINISTRATOR.DS.'models'.DS.'customfields.php');
$product_attribute VirtueMartModelCustomfields::CustomsFieldOrderDisplay($item,'FE');
echo $product_attribute;
}
?>

</td>
<td align="left">&nbsp;

</td>
<td align="left"   class="priceCol" >
    <?php echo '<span >'.$this->currency->priceDisplay($item->product_item_price$this->currency) .'</span><br />'?>
</td>
<td align="left" >
<?php echo $qtt?>
</td>
<?php if ( VmConfig::get('show_tax')) { ?>
<td align="left" class="priceCol"><?php echo "<span  class='priceColor2'>".$this->currency->priceDisplay($item->product_tax ,$this->currency$qtt)."</span>" ?></td>
                                <?php ?>
<td align="left" class="priceCol" >
<?php echo  $this->currency->priceDisplay$item->product_subtotal_discount$this->currency );  //No quantity is already stored with it ?>
</td>
<td align="left"  class="priceCol">
<?php
$item->product_basePriceWithTax = (float) $item->product_basePriceWithTax;
$class '';
if(!empty($item->product_basePriceWithTax) && $item->product_basePriceWithTax != $item->product_final_price ) {
echo '<span class="line-through" >'.$this->currency->priceDisplay($item->product_basePriceWithTax,$this->currency,$qtt) .'</span><br />' ;
}

echo $this->currency->priceDisplay(  $item->product_subtotal_with_tax ,$this->currency); //No quantity or you must use product_final_price ?>

</td>
</tr>

<?php
}
?>

<tr><td colspan="<?php echo $colspan ?>"></td></tr><tr><td>&nbsp;</td></tr><tr><td>&nbsp;</td></tr>
<tr class="sectiontableentry1">
<td colspan="6" align="left"><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_PRODUCT_PRICES_TOTAL'); ?></td>

                        <?php if ( VmConfig::get('show_tax')) { ?>
<td align="left"><?php echo "<span  class='priceColor2'>".$this->currency->priceDisplay($this->orderDetails['details']['BT']->order_tax$this->currency)."</span>" ?></td>
                        <?php ?>
<td align="left"><?php echo "<span  class='priceColor2'>".$this->currency->priceDisplay($this->orderDetails['details']['BT']->order_discountAmount$this->currency)."</span>" ?></td>
<td align="left"><?php echo $this->currency->priceDisplay($this->orderDetails['details']['BT']->order_salesPrice$this->currency?></td>
  </tr>
<?php
if ($this->orderDetails['details']['BT']->coupon_discount <> 0.00) {
    
$coupon_code=$this->orderDetails['details']['BT']->coupon_code?' ('.$this->orderDetails['details']['BT']->coupon_code.')':'';
?>

<tr>
<td align="left" class="pricePad" colspan="5"><?php echo JText::_('COM_VIRTUEMART_COUPON_DISCOUNT').$coupon_code ?></td>
<td align="left"></td>

<?php if ( VmConfig::get('show_tax')) { ?>
<td align="left"> </td>
                                <?php ?>
<td align="left"><?php echo '- '.$this->currency->priceDisplay($this->orderDetails['details']['BT']->coupon_discount$this->currency); ?></td>
<td align="left"></td>
</tr>
<?php  ?>


<?php
foreach($this->orderDetails['calc_rules'] as $rule){
if ($rule->calc_kind== 'DBTaxRulesBill') { ?>

<tr >
<td colspan="6"  align="left" class="pricePad"><?php echo $rule->calc_rule_name ?> </td>

                                   <?php if ( VmConfig::get('show_tax')) { ?>
<td align="left"> </td>
                                <?php ?>
<td align="left"> <?php echo  $this->currency->priceDisplay($rule->calc_amount$this->currency);  ?></td>
<td align="left"><?php echo  $this->currency->priceDisplay($rule->calc_amount$this->currency);  ?> </td>
</tr>
<?php
} elseif ($rule->calc_kind == 'taxRulesBill') { ?>

<tr >
<td colspan="6"  align="left" class="pricePad"><?php echo $rule->calc_rule_name ?> </td>
<?php if ( VmConfig::get('show_tax')) { ?>
<td align="left"><?php echo $this->currency->priceDisplay($rule->calc_amount$this->currency); ?> </td>
<?php ?>
<td align="left"><?php    ?> </td>
<td align="left"><?php echo $this->currency->priceDisplay($rule->calc_amount$this->currency);   ?> </td>
</tr>
<?php
 } elseif ($rule->calc_kind == 'DATaxRulesBill') { ?>

<tr >
<td colspan="6"   align="left" class="pricePad"><?php echo $rule->calc_rule_name ?> </td>
<?php if ( VmConfig::get('show_tax')) { ?>
<td align="left"> </td>
<?php ?>
<td align="left"><?php  echo   $this->currency->priceDisplay($rule->calc_amount$this->currency);  ?> </td>
<td align="left"><?php echo $this->currency->priceDisplay($rule->calc_amount$this->currency);  ?> </td>
</tr>

<?php
 }

}
?>



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

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

<tr>
<td align="left" class="pricePad" colspan="6"><?php echo $this->orderDetails['paymentName'?></td>

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

<tr>
<td align="left" class="pricePad" colspan="6"><strong><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_TOTAL'?></strong></td>

<?php if ( VmConfig::get('show_tax')) { ?>
<td align="left"><span class='priceColor2'><?php echo $this->currency->priceDisplay($this->orderDetails['details']['BT']->order_billTaxAmount$this->currency); ?></span></td>
<?php ?>
<td align="left"><span class='priceColor2'><?php echo $this->currency->priceDisplay($this->orderDetails['details']['BT']->order_billDiscountAmount$this->currency); ?></span></td>
<td align="left" width="10%"><strong><?php echo $this->currency->priceDisplay($this->orderDetails['details']['BT']->order_total$this->currency); ?></strong></td>
</tr>

</table>





K&K media production

Hi

the css styles must in the head area of your mail_html.php:

<head>
<style type="text/css">
your styles
</style>
</head>

Regards,
Maik

LuukDriessen

The CSS styles are currently correct between the <head> tag.
But with Gmail the CSS has be between the <body> (inline). That 's what I don't understand/familiar with.

About the positioning/alignment.
The 'total' check out column doesn't align correctly. But I need to change this in in the code, not the css. Right?

Well, I changed the alignment as you can see above.

What am I doing wrong.

For more information/questions please ask!




K&K media production

You have align="left" and your alignment is on left site. What is wrong?