2

I'm trying to add a link to the order confirmation IF the order has the word ebook. This is a bundled product so it doesn't bring in the SKU for the product I'm referring to. I don't know this is even possible. All I want to do it show a link if the ebook is in the order. If it's not in the order don't show the link. Here's what I have so far.

{{if order.getEmailCustomerNote()}} 
        <table cellspacing="0" cellpadding="0" class="message-container">
            <tr>
                <td>{{var order.getEmailCustomerNote()}}</td>
            </tr>
        </table>
        {{else}}
       {{depend order.getitem().item == 'ebook'}}
       <table cellspacing="0" cellpadding="0" class="message-container">
        <tr>
        <td>{{var order.getEmailCustomerNote()}}</td>
        </tr>
        <tr>
          <p><h2>THE LINK</h2></p>
        </tr>
        </table>

     {{/depend}}
  {{/if}}
  • What is ebook? Is this type of product? Or this is name or part of name, or product category? – Stepan Furman Jan 8 '18 at 1:49
  • It's the product name. I was going to use SKU but since it's in a bundled product it doesn't have the SKU for the ebook. – Jad Jan 8 '18 at 2:03
0

This is not impossible. But this will allow some development skills from you. You have to override order model and add your own method that you will be able to call from email templae. In this method you have to pull all order items and products and check if there is a children with particular sku

  • I'm trying to find the phtml file but can't find which one to change. I've changed the item.phtml and default.phtml but nothing changes. The handle for the layout is - handle="sales_email_order_items".... if that helps. I'm not great with magento but know php. – Jad Jan 8 '18 at 4:15

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.