Magento EE 1.11-客户属性不可见

Magento EE 1.11-客户属性不可见,magento,attributes,Magento,Attributes,我们的客户希望在客户注册中添加“行业”下拉列表。我们创建了一个新的客户属性“行业”,并输入了相应的值 它没有显示在前端。我查看了customer/form/register.phtml,它没有调用任何属性,因此我从enterprise/default/template/customer/form/register.phtml中提取了以下内容: <?php $customerAttributes = $this->getChild('customer_form_user_attribu

我们的客户希望在客户注册中添加“行业”下拉列表。我们创建了一个新的客户属性“行业”,并输入了相应的值

它没有显示在前端。我查看了
customer/form/register.phtml
,它没有调用任何属性,因此我从
enterprise/default/template/customer/form/register.phtml中提取了以下内容:

<?php $customerAttributes = $this->getChild('customer_form_user_attributes');?>
<?php if ($customerAttributes): ?>
    <?php $customerAttributes->setShowContainer(false);?>
    <?php $this->restoreSessionData($customerAttributes->getForm());?>
    <?php echo $customerAttributes->toHtml()?>
<?php endif;?>
<pre>
<?php print_r($customerAttributes->getUserDefinedAttributes()) ?>
</pre>
此时,属性在前端不可见。如果我执行:



正如我所期望的那样,我得到了属性数组。这里缺少什么?

您应该检查控制用户定义属性的
模板/customer/form/userattributes.phtml
。我不知道,有人碰过这个文件吗?先检查一下这个

<customer_form_template_handle>
    <reference name="content">
        <block name="customer_form_template" type="enterprise_customer/form_template">
            <action method="addRenderer">
                <type>text</type>
                <renderer_block>enterprise_customer/form_renderer_text</renderer_block>
                <template>customer/form/renderer/text.phtml</template>
            </action>
            <action method="addRenderer">
                <type>textarea</type>
                <renderer_block>enterprise_customer/form_renderer_textarea</renderer_block>
                <template>customer/form/renderer/textarea.phtml</template>
            </action>
            <action method="addRenderer">
                <type>multiline</type>
                <renderer_block>enterprise_customer/form_renderer_multiline</renderer_block>
                <template>customer/form/renderer/multiline.phtml</template>
            </action>
            <action method="addRenderer">
                <type>date</type>
                <renderer_block>enterprise_customer/form_renderer_date</renderer_block>
                <template>customer/form/renderer/date.phtml</template>
            </action>
            <action method="addRenderer">
                <type>select</type>
                <renderer_block>enterprise_customer/form_renderer_select</renderer_block>
                <template>customer/form/renderer/select.phtml</template>
            </action>
            <action method="addRenderer">
                <type>multiselect</type>
                <renderer_block>enterprise_customer/form_renderer_multiselect</renderer_block>
                <template>customer/form/renderer/multiselect.phtml</template>
            </action>
            <action method="addRenderer">
                <type>boolean</type>
                <renderer_block>enterprise_customer/form_renderer_boolean</renderer_block>
                <template>customer/form/renderer/boolean.phtml</template>
            </action>
            <action method="addRenderer">
                <type>file</type>
                <renderer_block>enterprise_customer/form_renderer_file</renderer_block>
                <template>customer/form/renderer/file.phtml</template>
            </action>
            <action method="addRenderer">
                <type>image</type>
                <renderer_block>enterprise_customer/form_renderer_image</renderer_block>
                <template>customer/form/renderer/image.phtml</template>
            </action>
        </block>
    </reference>
</customer_form_template_handle>


  • 找到了它。需要customer.xml中的这些内容。出于某种原因,使用enterprise/default customer.xml不起作用,但我添加了这个,效果很好

    
    文本
    企业\客户/表单\呈现器\文本
    customer/form/renderer/text.phtml
    文本区
    企业\客户/表单\呈现器\文本区域
    customer/form/renderer/textarea.phtml
    多行
    企业\客户/表单\渲染器\多行
    customer/form/renderer/multiline.phtml
    日期
    企业\客户/表格\提交人\日期
    customer/form/renderer/date.phtml
    选择
    企业\客户/表单\呈现程序\选择
    customer/form/renderer/select.phtml
    多选
    企业\客户/表单\呈现程序\多选
    customer/form/renderer/multiselect.phtml
    布尔值
    企业\客户/表单\渲染器\布尔值
    customer/form/renderer/boolean.phtml
    文件
    企业\客户/表单\呈现程序\文件
    customer/form/renderer/file.phtml
    形象
    企业\客户/表单\渲染器\图像
    customer/form/renderer/image.phtml
    
    您是否从“要在中使用的表单”选项中选择了此属性的可用位置?有四个区域显示此属性,其中一个是“客户注册”。实际上,所有选项都设置正确。在前端,包含元素的
      在那里,但它是空的。另外,当打开模板路径提示时,模板正在加载;但是,当我将包切换到“enterprise/default”时,属性会正确显示,因此,尽管.xml和两个模板文件都与“enterprise/default”相同,但在某些地方肯定会有不同之处。我已创建了类型为“yes/no”的新客户地址属性。其在注册表窗体上正确显示,默认值为“否”。但它不会显示为现有客户在其“我的帐户”中选择的值。它显示3个选项,选择一个空白值以及“是”和“否”。。知道如何为现有客户选择默认值吗。我已经重新索引了数据并清除了缓存。ThanksI已创建类型为“是/否”的新客户地址属性。其在注册表窗体上正确显示,默认值为“否”。但它不会显示为现有客户在其“我的帐户”中选择的值。它显示3个选项,选择一个空白值以及“是”和“否”。。知道如何为现有客户选择默认值吗。我已经重新索引了数据并清除了缓存。谢谢
          <?php foreach ($this->getUserDefinedAttributes() as $attribute):?>
              <?php $attributeContent = $this->getAttributeHtml($attribute);?>
                  <?php if ($attributeContent): ?>
                     <li><?php echo $attributeContent;?></li>
                  <?php endif;?>
          <?php endforeach;?>
      
      <customer_form_template_handle>
          <reference name="content">
              <block name="customer_form_template" type="enterprise_customer/form_template">
                  <action method="addRenderer">
                      <type>text</type>
                      <renderer_block>enterprise_customer/form_renderer_text</renderer_block>
                      <template>customer/form/renderer/text.phtml</template>
                  </action>
                  <action method="addRenderer">
                      <type>textarea</type>
                      <renderer_block>enterprise_customer/form_renderer_textarea</renderer_block>
                      <template>customer/form/renderer/textarea.phtml</template>
                  </action>
                  <action method="addRenderer">
                      <type>multiline</type>
                      <renderer_block>enterprise_customer/form_renderer_multiline</renderer_block>
                      <template>customer/form/renderer/multiline.phtml</template>
                  </action>
                  <action method="addRenderer">
                      <type>date</type>
                      <renderer_block>enterprise_customer/form_renderer_date</renderer_block>
                      <template>customer/form/renderer/date.phtml</template>
                  </action>
                  <action method="addRenderer">
                      <type>select</type>
                      <renderer_block>enterprise_customer/form_renderer_select</renderer_block>
                      <template>customer/form/renderer/select.phtml</template>
                  </action>
                  <action method="addRenderer">
                      <type>multiselect</type>
                      <renderer_block>enterprise_customer/form_renderer_multiselect</renderer_block>
                      <template>customer/form/renderer/multiselect.phtml</template>
                  </action>
                  <action method="addRenderer">
                      <type>boolean</type>
                      <renderer_block>enterprise_customer/form_renderer_boolean</renderer_block>
                      <template>customer/form/renderer/boolean.phtml</template>
                  </action>
                  <action method="addRenderer">
                      <type>file</type>
                      <renderer_block>enterprise_customer/form_renderer_file</renderer_block>
                      <template>customer/form/renderer/file.phtml</template>
                  </action>
                  <action method="addRenderer">
                      <type>image</type>
                      <renderer_block>enterprise_customer/form_renderer_image</renderer_block>
                      <template>customer/form/renderer/image.phtml</template>
                  </action>
              </block>
          </reference>
      </customer_form_template_handle>