【问题标题】:Add Custom Invoice Data in Invoice email在发票电子邮件中添加自定义发票数据
【发布时间】:2013-12-17 06:13:05
【问题描述】:

这是我的发票电子邮件模板文件:

\wamp\www\magento\app\locale\en_US\template\email\sales\invoice_new.html
<td>
<h2 style="font-size:18px; font-weight:normal; margin:0;">Your Invoice #{{var invoice.increment_id}} for Order #{{var
order.increment_id}}</h2>
</td>

我不明白如何将订单 ID 传递给这个 html 文件。

{{var invoice.increment_id}} from where this varible pass in this html file??
{{var order.getShippingAddress().getTelephone()}} where is written this function in magento ?

我想使用这个变量并创建函数来从 magento 表中获取更多数据。那么为此我必须在哪里添加这个函数以及如何在 invoice_new.html 文件中调用这个函数?

【问题讨论】:

    标签: php magento email templates invoice


    【解决方案1】:

    变量在Mage_Sales_Model_Order_Invoice::sendEmail() 中设置。 请参阅此代码:

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

    您可以用同样的方式添加自己的数据。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-08-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多