2011-06-15 71 views
1

我有4个自定义属性已添加到客户帐户创建/编辑窗体。我也有一个基本上与现有注册表格完全相同的模板。唯一的区别是我在另一个模块中使用它,而后置动作是通过ajax完成的。自定义客户属性在自定义表格

我遇到的问题是自定义属性不显示在自定义模板上。

到目前为止,我的研究表明,我需要将“要使用的表单”的值添加到属性中。我通过重写Enterprise_Customer_Helper_Data类来完成。但是,这仍然无效,自定义属性不会显示在我创建的自定义模板上。

这是我在重写中覆盖的更新方法。新的使用表格是愿望清单注册。值是我的布局xml文件中的布局句柄。

任何帮助,这是非常感谢。

public function getCustomerAttributeFormOptions() 
{ 
    return array(
     array(
      'label' => Mage::helper('enterprise_customer')->__('Customer Checkout Register'), 
      'value' => 'checkout_register' 
     ), 
     array(
      'label' => Mage::helper('enterprise_customer')->__('Customer Registration'), 
      'value' => 'customer_account_create' 
     ), 
     array(
      'label' => Mage::helper('enterprise_customer')->__('Customer Account Edit'), 
      'value' => 'customer_account_edit' 
     ), 
     array(
      'label' => Mage::helper('enterprise_customer')->__('Admin Checkout'), 
      'value' => 'adminhtml_checkout' 
     ), 
     array(
      'label' => 'Wishlist Register', 
      'value' => 'clientcatalog_index_view' 
     ), 
    ); 
} 

这是我在我的布局xml文件中使用的块,它定义要使用的模板以及要附加到模板的操作。

  <block type="customer/form_register" name="customer_form_register_wishlist" template="wishlist/wishlist_register.phtml"> 
      <action method="append"><block>customer.form.register.fields.before</block><alias>form_fields_before</alias></action> 
      <action method="append"><block>customer_form_user_attributes</block></action> 
      <action method="append"><block>customer_form_address_user_attributes</block></action> 
     </block> 
+1

你看过自定义注册表单字段添加?它节省了大量的时间并为多站点提供支持。 – Darren 2011-06-15 20:35:36

回答

0

正如你可以看到app/design/frontend/base/default/template/customer/form/edit.phtml,形式是“harcoded”,你需要编辑模板,添加你想要的字段。

+0

情况并非如此,因为这些属于我正在使用的自定义eav属性。不是标准的硬编码属性。 – rottmanj 2011-06-15 18:53:29

+0

你正在使用“自定义eav属性”,因为所有的客户属性都是,所以有什么区别? – OSdave 2011-06-15 21:41:18