在Customer Attributes中加入cus_remarks (Customer Remarks)
再去以下位置修改電郵模板
System -> Transactional Emails -> New Order Confirmation Template (GLOBAL)
在你想顯示Customer Remarks的位置添加的此塊代碼
{{block type='core/template' area='frontend' template='payment_info_for_email/custom_admin_remarks.phtml' order=$order email=$email }}
之後在此路徑下創建此 custom_admin_remarks.phtml 並插入以下代碼
app\design\frontend\default\default\template\payment_info_for_email\custom_admin_remarks.phtml
<?php
$_order = $this->getOrder();
$_email = $this->getEmail();
$orderid= $_order->getId();
$order_data=Mage::getModel('sales/order')->load($orderid);
$customer_id =$order_data->getCustomerId();
$customerData = Mage::getModel('customer/customer')->load($customer_id);
$this_cus_remark=$customerData->getCusRemarks();
// 修改 XX Email1 XX , XX Email 2 XX, 只有這些收件者才看到的管理員備註(Customer Remarks)
if ($this_cus_remark!='' && ($_email=="XX Email 1 XX" || $_email=="XX Email 2 XX")){
echo '<table cellspacing="0" cellpadding="0">
<tr><td>ADMIN REMARK 管理員備註:</td></tr>
<tr>
<td>'.$this_cus_remark.'</td>
</tr>
</table>';
}
?>