Magento – New order email missing sales_email_order_items block

blocksemail-templates

The new order email template is rendering everything except the contents of the order. I've tested that I'm looking at the correct template by adding in dummy text so I'm definitely in the right place.

This is how the template was trying to call it by default, which doesn't work:

{{layout handle="sales_email_order_items" order=$order}}

I've tried a few other ways of calling the block also such as:

{{block type="sales_email_order_items" order=$order}}

{{block type="sales_email_order_items" order=$order}}

{{block type="sales/email_order_items" template="email/order/items.phtml"  order=$order}}

These clearly didn't work, or I wouldn't be posting here. Can anyone advise on what might be the problem.

Best Answer

The issue came down to a conflict. The {{layout handle="sales_email_order_items" order=$order}} wasn't working because the block it was trying to load - sales/order_email_items was being extended by a module that had been disabled.

I tested the sales_email_order_items handle by removing what was in it by default and adding a call to a file just containing static text, which worked. From here I realised that there must be a bug in the blocks it was trying to load and found that I needed to delete the configuration file completely rather than just disable the module of the offending module to stop the conflict.