2012-10-05 77 views
0

是否有可能在creditmemo电子邮件中使用{{var invoice.increment_id}}?它不工作,如果我这样做...Magento - 交易电子邮件 - 变量

<p><strong>Bestellnummer:</strong> {{var order.increment_id}}</p> 
<p><strong>Datum:</strong> {{var creditmemo.created_at}}</p> 
<p><strong>Rechnung:</strong> {{var invoice.increment_id}}</p> 
<p>Liebe(r) {{htmlescape var=$order.getCustomerName()}},<br/><br/> 

不起作用。有人对我有暗示吗?谢谢!

编辑
这是正确的吗? 编辑类Mage_Sales_Model_Order_Creditmemo并添加:

//Get Invocie from order Object 
     if ($order->hasInvoices()) { 
      // "$_eachInvoice" is each of the Invoice object of the order "$order" 
      foreach ($order->getInvoiceCollection() as $_eachInvoice) { 
       $invoice = $_eachInvoice->getIncrementId(); 
      } 

      //$invoice = $order->getInvoiceCollection(); 
     } 

藏汉作为

$mailer->setTemplateParams(array(
       'order'  => $order, 
       'creditmemo' => $this, 
       'comment' => $comment, 
       'invoice' => $invoice, 
       'billing' => $order->getBillingAddress() 
      ) 
     ); 

事后调用我的电子邮件模板变量{{VAR发票}}?
但它不显示,我在这里失踪?

回答

2

您应该在您的模块中重写Mage_Sales_Model_Order_Creditmemo模型并添加所需的逻辑sendUpdateEmail()方法以获得贷记凭证电子邮件模板中的发票对象。

+0

试试吧!谢谢 – Marek123

0

看到我的第一篇文章。我说得对。感谢Zyava。
问题是,你必须在sendEmail()的sendUpdateEMail()之上放置这段代码。

谢谢!

相关问题