【问题标题】:Magento - Transaction E-Mails - VariablesMagento - 交易电子邮件 - 变量
【发布时间】:2012-10-05 19:00:34
【问题描述】:

是否可以在 creditmemo 电子邮件中使用 {{var invoice.increment_id}}?如果我这样做它不起作用......

<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 invoice}}?
但它没有显示,我在这里缺少什么?

【问题讨论】:

    标签: magento variables invoice


    【解决方案1】:

    您应该在您的模块中重写Mage_Sales_Model_Order_Creditmemo 模型并将所需的逻辑添加到sendUpdateEmail() 方法以在贷项通知单电子邮件模板中获取发票对象。

    【讨论】:

      【解决方案2】:

      请参阅我的第一篇文章。我猜对了。感谢 Zyava。
      问题是,您必须将此代码放在 sendUpdateEMail() 之上的一种方法,在 sendEmail() 中。

      谢谢!

      【讨论】:

        猜你喜欢
        • 2013-02-13
        • 1970-01-01
        • 2015-10-13
        • 1970-01-01
        • 2014-05-30
        • 1970-01-01
        • 2013-11-21
        • 2021-12-02
        • 1970-01-01
        相关资源
        最近更新 更多