2

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?

3
  • It is possible but please tell me what template you want it in, I will help you then. Commented 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".
    – McKeene
    Commented Nov 8, 2014 at 23:13
  • Well looks like @R.S beat me to it, this is a correct answer. Commented Nov 8, 2014 at 23:14

1 Answer 1

4

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
 }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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