如何在shopify的客户注册页面中添加自定义字段?

时间:2019-05-29 10:05:14

标签: shopify

我在客户注册页面上添加了一个“自定义”字段。

字段名称:区域。

我已尝试保存它们,所有详细信息均已保存,但“面积”值未保存。

有人可以帮助我解决该问题吗?

      {%form'create_customer'%}

    {{ form.errors | default_errors }}

    <label for="FirstName" class="hidden-label">{{ 'customer.register.first_name' | t }}</label>
    <input type="text" name="customer[first_name]" id="FirstName" class="input-full" placeholder="{{ 'customer.register.first_name' | t }}" {% if form.first_name %}value="{{ form.first_name }}"{% endif %} autocapitalize="words" autofocus required>

    <label for="LastName" class="hidden-label">{{ 'customer.register.last_name' | t }}</label>
    <input type="text" name="customer[last_name]" id="LastName" class="input-full" placeholder="{{ 'customer.register.last_name' | t }}" {% if form.last_name %}value="{{ form.last_name }}"{% endif %} autocapitalize="words" required>

    <label for="Email" class="hidden-label">{{ 'customer.register.email' | t }}</label>
    <input type="email" name="customer[email]" id="Email" class="input-full{% if form.errors contains 'email' %} error{% endif %}" placeholder="{{ 'customer.register.email' | t }}" {% if form.email %} value="{{ form.email }}"{% endif %} autocorrect="off" autocapitalize="off" required>

  <label for="Area" class="hidden-label">{{ 'customer.register.area' | t }}</label>

  <input type="text" id="Area" name="customer[note][area]" placeholder="Customer Area" class="input-full"  autocorrect="off" autocapitalize="off">

    <label for="CreatePassword" class="hidden-label">{{ 'customer.register.password' | t }}</label>
    <input type="password" name="customer[password]" id="CreatePassword" class="input-full{% if form.errors contains 'password' %} error{% endif %}" placeholder="{{ 'customer.register.password' | t }}" required>

    <p>
      <input type="submit" value="{{ 'customer.register.submit' | t }}" class="btn btn--full registerBtn" ng-click="myfunction();" id="create">
    </p>
    <a href="{{ shop.url }}">{{ 'customer.register.cancel' | t }}</a>

  {% endform %}
</div>

1 个答案:

答案 0 :(得分:0)

无法在前端显示备注字段,但您应该能够以保存方式存储它。

如果您想输出某些内容,则必须使用标签。

例如:<input type="text" class="field" name="customer[tags]" value="" >

您将可以访问customer.tags中的标签。这样,您将能够显示标签/字段。