I am thinking of selling tickets using the virtual product function. Therefore I would like to add text to the email template only if an virtual product is present. Is this possible?
-
It is possible but please tell me what template you want it in, I will help you then.– Toon Van DoorenCommented Nov 8, 2014 at 23:03
-
Thank you Toon. I would like to add it to the order confirmation for both logged in users and guests. I would simply like to add a little text before the order ID like "Please show this order confirmation at the shop to receive your tickets".– McKeeneCommented Nov 8, 2014 at 23:13
-
Well looks like @R.S beat me to it, this is a correct answer.– Toon Van DoorenCommented Nov 8, 2014 at 23:14
Add a comment
|
1 Answer
One of the easer way would be to include a pthml file to your email
Add code below to location where text to be display in your email template
{{block type='core/template' area='frontend' template='<module_name>/orderemail.phtml' order=$order}}
in your template file /orderemail.phtml
$_order = this->getOrder()
$hasVirtual = false;
$items = $order->getAllVisibleItems();
foreach($items as $i){
if( $i->->getIsVirtual()){
$hasVirtual = true;
}
}
if($hasVirtual){
echo 'text here
}