Hi !!
I am trying to customize email template "Order Confirmation". I did not want to send customer fields as displayed by default {order_details}.
Following is the code I wrote. It works fine, it just the out put which goes in one line without formating.
Code:
{php}
$ordernumber = $this->_tpl_vars["order_number"];
$sel_orders = "select id,packageid,billingcycle,domain,amount from tblhosting where orderid = (select id from tblorders where ordernum = ".$ordernumber.")";
$productind = 0;
echo 'ORDER NUMBER: '.$ordernumber;
$res_orders = mysql_query($sel_orders);
while($rec_orders = mysql_fetch_array($res_orders))
{
echo '<br><br>Product Details<br>';
$sel_products = "select * from tblproducts where id = ".$rec_orders['packageid'];
$res_products = mysql_query($sel_products);
$rec_products = mysql_fetch_array($res_products);
echo 'Product/Service:'.$rec_products['name']."<br>";
echo 'Domain:'.$rec_orders['domain']."<br>";
echo 'Setup Fee:'.$rec_products['msetupfee']."<br>";
echo 'Recurring Amount:'.$rec_orders['amount']."<br>";
echo 'Billing Cycle:'.$rec_orders['billingcycle']."<br><br>";
$sel_addons = "select id,name,setupfee,recurring,billingcycle from tblhostingaddons where orderid = (select id from tblorders where ordernum = ".$ordernumber.")";
$res_addons = mysql_query($sel_addons);
echo '<strong>Addon Detials</strong><br><br>';
$addcount = 0;
while($rec_addons = mysql_fetch_array($res_addons))
{
$addcount++;
echo 'Addon Name: '.$rec_addons['name'].'<br>';
echo 'Setup Fee: '.$rec_addons['setupfee'].'<br>';
echo 'Recurring Amount: '.$rec_addons['recurring'].'<br>';
echo 'Billing Cycle: '.$rec_addons['billingcycle'].'<br><br>';
}
}
{/php}
The output looks like....
ORDER NUMBER: 2984937321Product DetailsProduct/Service:Gold PackageDomain:confirmtest.inSetup Fee:299.00Recurring Amount:49.00Billing Cycle:Monthly<strong>Addon Detials</strong>Addon Name: ForumSetup Fee: 199.00Recurring Amount: 0.00Billing Cycle: One Time
Question: How do I introduce HTML formating tags in the php code above, such that the output is well structured? (I do not understand Smarty very well.