如何在 Magento 的新订单模板上添加额外的细节

How to add extra details on new order placed template Magento

我想为下订单添加一些额外的细节 email.I 在语言环境中找到了 html 文件,但我想添加动态 text.For,我想从中添加该代码在那里调用此文件发送 email.Can 有人帮助我在哪里可以找到发送订单电子邮件的文件。

您需要覆盖此模型 app/code/local/Mage/Sales/Model/Order.php 重写这个方法

public function sendNewOrderEmail()
  {
  --- default code ----
  $mailer->setTemplateParams(array(
            'order'        => $this,
            'dynamicvariable'    => $dynamicvariable,
            'billing'      => $this->getBillingAddress(),
            'payment_html' => $paymentBlockHtml
        )
    );
  --- default code ----
 }

在上面的方法中,我添加了动态变量,您可以在订单电子邮件模板系统 -> 交易电子邮件 -> 新订单模板中使用 像这样

{{var $dynamicvariable}}

第 1 步:- 创建一个文件在此位置 app/design/frontend/your_package/your_theme/template/email/shipnote.phtml 中添加您的代码,例如:-

$order = $this->getOrder();
$note = $order->getYourData(); // (or whatever is the code for getting the your data message)
echo $note;

第 2 步:- 现在打开您的交易电子邮件模板,您可以找到它 system->>Transactional Emails 或 app/locale/en_US/template/email/sales/order_new.html 并在其中添加以下代码:-

{{block type='core/template' area='frontend' template='email/shipnote.phtml' order=$order}}