을
덕분에 내 사용자 지정 'COMPANYNAME'속성을 포함하는이 사용자 정의 변수를 생성 및 판매 이메일 템플릿의 모든 유형에 전달할 수있는
어느 한 파일을 지적 할 수 내가 바꿀 파일을 찾았 어. 나는 이미 내 속성의 하나로서 'COMPANYNAME'을 가지고 있기 때문에 나는이 필드의 값을 검색하고 다음 함수
응용 프로그램/코드/코어/마법사/판매/모델에서 PARAM/Order.php
로 통과
public function sendNewOrderEmail()
{
/*Existing Code*/
if ($this->getCustomerIsGuest()) {
$templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_GUEST_TEMPLATE, $storeId);
$customerId = Mage::getModel('customer/customer')->load($this->getCustomerId());
$companyname = $customerId->getCompanyname();
$customerName = $this->getBillingAddress()->getName();
} else {
$templateId = Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE, $storeId);
$customerId = Mage::getModel('customer/customer')->load($this->getCustomerId());
$companyname = $customerId->getCompanyname();
$customerName = $this->getCustomerName();
}
/*Existing Code*/
$mailer->setTemplateParams(array(
'order' => $this,
'billing' => $this->getBillingAddress(),
'payment_html' => $paymentBlockHtml,
'companyname' => $companyname
));
/*Rest of the code remains the same*/
}
변경 후. 이 매개 변수를 포함하도록 거래 전자 메일을 편집했습니다. 내가 배송 주소 내부에 표시하고 싶어하기 때문에 당신의 COMPANYNAME은 다음이 '배송 주소에 주문 이메일에 표시 얻을 것이다 고객 정보의 일부로 저장하게 될 경우, 그냥
System > Transactional Emails > New Order Email
{{ var companyname }}
{{var order.getShippingAddress.format('html')}}
에서이 줄 앞에 내 변수를 배치 '시작에서의 정보 권리.
송장 및 발송 전자 우편에 대해서도 동일한 작업을 수행 할 수 있습니다.
호프가 도움이 되었기를 바랍니다. :-)
출처
2012-07-09 14:41:42
ivn
어떤 경우에도 핵심 파일을 편집해서는 안됩니다! ... 코어 코드를 변경할 다른 기회가 없다면 해당 파일의 복사본을 만들어 app/code/local/Mage/Sales/Model/Order.php에 저장하십시오 –