【问题标题】:How to print an EAV-value in email template如何在电子邮件模板中打印 EAV 值
【发布时间】:2015-06-04 05:17:34
【问题描述】:

我为客户对象引入了一个自定义 EAV 属性。我们称之为myvalue。在 magento 的几个地方,我正在打印这样的值:

echo Mage::getSingleton('customer/session')->getCustomer()->getMyvalue();

现在,我想将其打印到订单确认电子邮件模板中。我该怎么做?

【问题讨论】:

标签: php magento magento-1.9


【解决方案1】:

我找到了解决办法。

首先,我在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}}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-12
    • 1970-01-01
    • 2020-09-04
    • 2017-07-25
    • 1970-01-01
    • 2012-05-17
    相关资源
    最近更新 更多