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. Nov 8 '14 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".
    – McKeene
    Nov 8 '14 at 23:13
  • Well looks like @R.S beat me to it, this is a correct answer. Nov 8 '14 at 23:14

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;

    echo 'text here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.