2013-03-17 88 views
3

我无法找到如何添加自定义字段用户注册论坛的任何文件,所以我尝试的东西,但没有奏效:对Shopify用户登记表的自定义字段

<div class="single-full-width customer"> 
    <div class="login"> 
     {% form 'create_customer' %} 
      {% if form.errors %} 
       {% for field in form.errors %} 
        <p class="input-error-wrapper"><span>{{field}} {{ form.errors.messages[field] }}</span></p> 
       {% endfor %} 
      {% endif %} 
      <p> 
       <label>First Name:</label> 
       <input type="text" value="" name="customer[first_name]" class="input-text-1" /> 
      </p> 
      <p> 
       <label>Last Name:</label> 
       <input type="text" value="" name="customer[last_name]" class="input-text-1" /> 
      </p> 
      <p> 
       <label>Email Address:</label> 
       <input type="text" value="" name="customer[email]" class="input-text-1" /> 
      </p> 

      <p> 
       <label>Password:</label> 
       <input type="password" value="" name="customer[password]" class="input-text-1" /> 
      </p> 

      <p> 
       <label>Pet Name:</label> 
       <input type="text" value="" name="customer[pet_name]" class="input-text-1" /> 

       <input type="radio" name="customer[pet]" value="cat">Cat 
       <input type="radio" name="customer[pet]" value="dog">Dog 
      </p> 

      <p class="sign-in"> 
       <label></label> 
       <a href="#" class="button-1 custom-font-1 trans-1 form-submit-btn"><span>Register</span></a> 
       <b>or <a href="{{ shop.url }}">Return to store</a></b> 
      </p> 
     {% endform %} 
    </div> 

我已经字段添加了文本输入 - 宠物名称和猫/狗的收音机。 我已经使用了一个测试帐户,但输出结果是没有保存。我用{{customer.pet_name}}尝试获取保存的值,但没有任何回报。 有什么建议吗?谢谢!

回答

2

将您的宠物名称保存在标签或记事本中,因为这些名称适用于客户。 pet_name显然不是客户领域。

<p> 
    <label>Pet Name:</label> 
    <input type="text" value="" name="customer[note]" class="input-text-1" /> 
    <input type="radio" name="customer[tags]" value="cat">Cat 
    <input type="radio" name="customer[tags]" value="dog">Dog 
</p> 
+0

你能联系我一些如何做到这一点的信息?我找不到多少 – 2013-03-17 19:01:03

+0

完成..看我的代码除了我的答案。 – 2013-03-18 00:13:25

+0

我讨厌再次打扰你,但我怎样才能返回值? {{customer.note}}和{{customer.cat}}? – 2013-03-18 16:34:30

相关问题