Php 如何在电子邮件模板中打印EAV值
我已经为customer对象引入了一个自定义EAV属性。让我们称之为Php 如何在电子邮件模板中打印EAV值,php,magento,magento-1.9,Php,Magento,Magento 1.9,我已经为customer对象引入了一个自定义EAV属性。让我们称之为myvalue。在magento的几个地方,我打印的值如下: echo Mage::getSingleton('customer/session')->getCustomer()->getMyvalue(); 现在,我想将其打印到订单确认电子邮件模板中。我该怎么做呢?我找到了解决办法 首先,我在app/design/frontend/base/default/template/中创建了一个新目录mydirector
myvalue
。在magento的几个地方,我打印的值如下:
echo Mage::getSingleton('customer/session')->getCustomer()->getMyvalue();
现在,我想将其打印到订单确认电子邮件模板中。我该怎么做呢?我找到了解决办法 首先,我在
app/design/frontend/base/default/template/
中创建了一个新目录mydirectory
。在这个目录中,我放置了一个包含以下内容的文件myvalue.phtml
<?php
$customer=$this->getData('order')->getCustomer();
print_r($customer->getMyvalue());
?>
这可能对你有帮助
{{block type='core/template' area='frontend' template='mydirecory/myvalue.phtml' order=$order}}