News:

Looking for documentation? Take a look on our wiki

Main Menu

Insert category and manufacturer in the confirmation email

Started by fabribaju, November 09, 2015, 20:39:14 PM

Previous topic - Next topic

fabribaju

Hello everyone, sorry my english. I am wanting to enter the category and product manufacturer's purchase confirmation e-mail (order confirmation). I'm not a programmer and I've tried a number of ways. The following example and my page code:



<?php

defined
('_JEXEC') or die('Restricted access');

$colspan=8;

if (
$this->doctype != 'invoice') {
    
$colspan -= 4;
} elseif ( ! 
VmConfig::get('show_tax')) {
    
$colspan -= 1;
}
 
?>

<style type="text/css">

table.alternate_color tr:nth-child(odd) td{
  color: #CB000F;
}
table.alternate_color tr:nth-child(even) td{
   background-color: #9999ff;
}
</style>
<table class="html-email" width="800px" cellspacing="0" cellpadding="0" border="0">
<tr align="left" class="sectiontableheader" style="background-color:#666; color:#FFF; font-weight:bold;">
<td colspan="2" align="left" valign="middle"><strong><?php echo vmText::_('COM_VIRTUEMART_PRODUCT_NAME_TITLE'?></strong></td>
<td width="185" height="40" align="center" valign="middle"><strong><?php echo vmText::_('COM_VIRTUEMART_ORDER_PRINT_PRICE'?></strong></td>
<?php if ($this->doctype == 'invoice') { ?>
<?php ?>
  <td width="94" align="center" valign="middle"><strong><?php echo vmText::_('COM_VIRTUEMART_ORDER_PRINT_QTY'?></strong></td>
<td colspan="2" align="center" valign="middle"><strong><?php echo vmText::_('COM_VIRTUEMART_ORDER_PRINT_SKU'?></strong></td>
<?php if ($this->doctype == 'invoice') { ?>
<?php if ( VmConfig::get('show_tax')) { ?>
<?php ?>
  <td width="67" align="right" valign="middle"><strong><?php echo vmText::_('COM_VIRTUEMART_ORDER_PRINT_TOTAL'?></strong></td>
<?php ?>
</tr>

<?php
$menuItemID shopFunctionsF::getMenuItemId($this->orderDetails['details']['BT']->order_language);

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 '&Itemid=' $menuItemID;

?>

<tr valign="top">
  <td colspan="2" align="left" valign="middle" style="border-bottom:1px dashed #999;">
  <div float="right" style="font-weight:bold;" ><?php echo $item->order_item_name?></div>
             
       
         
           
           
           
  <?php
//if (!empty($item->product_attribute)) {
if(!class_exists('VirtueMartModelCustomfields'))require(VMPATH_ADMIN.DS.'models'.DS.'customfields.php');
$product_attribute VirtueMartModelCustomfields::CustomsFieldOrderDisplay($item,'FE');
echo $product_attribute;
//}
?>
    </td>
<td height="40" align="center" valign="middle"style="border-bottom:1px dashed #999;">
<?php
$item->product_discountedPriceWithoutTax = (float) $item->product_discountedPriceWithoutTax;
if (!empty($item->product_priceWithoutTax) && $item->product_discountedPriceWithoutTax != $item->product_priceWithoutTax) {
echo '<span >'.$this->currency->priceDisplay($item->product_discountedPriceWithoutTax$this->currency) .'</span><br />';
} else {
echo '<span >'.$this->currency->priceDisplay($item->product_item_price$this->currency) .'</span><br />'
}
?>
</td>
<?php if ($this->doctype == 'invoice') { ?>
  <?php ?>
<td align="center" valign="middle" style="border-bottom:1px dashed #999;">
<?php echo $qtt?>
  </td>
<td colspan="2" align="center" valign="middle" style="border-bottom:1px dashed #999;"><?php echo $item->order_item_sku?></td>
<?php if ($this->doctype == 'invoice') { ?>
<?php if ( VmConfig::get('show_tax')) { ?>
<?php ?>
<td align="right" valign="middle"  class="priceCol" style="border-bottom:1px dashed #999;">
<?php
$item->product_item_price != $item->product_final_price;

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

</td>
<?php ?>
</tr>

<?php
}
?>

<?php if ($this->doctype == 'invoice') { ?>
<tr><td width="19" colspan="<?php echo $colspan ?>"></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="right" class="pricePad" colspan="4">&nbsp;</td>
<?php if ( VmConfig::get('show_tax')) { ?>
<td width="5%" align="right">&nbsp;</td>
<?php ?>
<td width="67" align="right">&nbsp;</td>
<td align="right">&nbsp;</td>
</tr>
<?php  ?>


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

if ($rule->calc_kind == 'DBTaxRulesBill' or $rule->calc_kind == 'DATaxRulesBill') { ?>

<tr >
<td colspan="4" align="right" class="pricePad">&nbsp;</td>
<?php if ( VmConfig::get('show_tax')) { ?>
<td align="right">&nbsp;</td>
<?php ?>
<td align="right">&nbsp;</td>
<td align="right">&nbsp;</td>
</tr>
<?php
} elseif ($rule->calc_kind == 'taxRulesBill' or $rule->calc_kind == 'VatTax' ) { ?>

<?php
}
?>


<tr style="background-color:#ccc; color:#000; font-weight:bold;">
<td colspan="4" align="right" valign="middle" class="pricePad"><strong><?php echo vmText::_('COM_VIRTUEMART_ORDER_PRINT_TOTAL'?></strong></td>

<?php if ( VmConfig::get('show_tax')) { ?>
  <td align="right">&nbsp;</td>
<?php ?>
<td align="right">&nbsp;</td>
<td height="40" align="right" valign="middle"><strong><?php echo $this->currency->priceDisplay($this->orderDetails['details']['BT']->order_total$this->currency); ?></strong></td>
</tr>

<?php ?>
</table>



fabribaju

I got it but do not know how I could adapt to my needs. Any tips?