I am working on modifying email templates. {themeName}/template/email/order/items/order/default.phtml
The above template triggers when the user (guest or customer) has placed the order.
In the above template, there are some variables like:
$_item = $this->getItem();
$_order = $this->getItem()->getOrder();
if I use any debugging methods like Mage::log
or zend_debug::dump
, the checkout page is hanging up and the order is never being processed.
So, my question is what should I use to debug email templates here?
I also used echo
which is always showing an empty string or array
for an array holding variable.
Mage::log
in the block class (Mage_Sales_Block_Order_Email_Items_Order_Default
)?Mage::log
inMage_Sales_Block_Items_Abstract
. which has the same issue as I mentioned above in my post. I didn't get relation to your mentioned class.app/locale/en_US/template/email/sales/order_new_guest.html
(for guest). There, a layout handle is inserted -sales_email_order_items
. This handle is declared inapp/design/frontend/base/default/layout/sales.xml
. The template you're having problems with has the block set tosales/order_email_items_order_default
- akaMage_Sales_Block_Order_Email_Items_Order_Default
.{themeName}/template/email/order/items/order/default.phtml
(I checked it thoroughly) The other part of email like "Thank you for purchasing.. blah blah blah" is coming from what you have mentioned above (I didn't check but I think so). To be frank, I solved this problem but my question is how to debug in these email templates?