我必须在密码中包含注册表。liquid (Shopify)…表单可以工作,但是表单处理后没有显示成功消息…根据文档,它应该可以工作。
{% form 'create_customer', class: 'customer-register' %}
{% if form.posted_successfully? %}
<div>Thank you for your enquiry! We will get back to you as soon as possible!</div>
{% else %}
{{ form.errors | default_errors }}
{% endif %}
<div id="naeark">New Account Enquiry</div>
<div id="naetark">To get started as a Plum & Ashby stockist, please tell us a little about your store!</div>
<input type="text" id="arkfn" placeholder="First Name" value="{{ form.first_name }}" name="customer[first_name]" class="{% if form.errors contains "first_name" %}error{% endif %}">
<input type="text" id="arkln" placeholder="Last Name" value="{{ form.last_name }}" name="customer[last_name]" class="{% if form.errors contains "last_name" %}error{% endif %}">
<input type="text" id="arkmail" placeholder="Email" value="{{ form.email }}" name="customer[email]" class="{% if form.errors contains "email" %}error{% endif %}">
<input id="telephone" type="text" name="customer[note][Telephone]" placeholder="Telephone" />
<input id="website" type="text" name="customer[note][Website]" placeholder="Website" />
<input id="storename" type="text" name="customer[note][StoreName]" placeholder="Store Name" />
<input id="streetaddress1" type="text" name="customer[note][StreetAddress]" placeholder="Street Address" />
<input id="streetaddress2" type="text" name="customer[note][StreetAddress2]" placeholder="Street Address 2" />
<input id="City" type="text" name="customer[note][City]" placeholder="City" />
<input id="state-region" type="text" name="customer[note][state-region]" placeholder="State/Region" />
<input id="Country" type="text" name="customer[note][Country]" placeholder="Country" />
<input id="Zip-PostalCode" type="text" name="customer[note][Zip-PostalCode]" placeholder="Zip/Postal Code" />
<div id="ATCont">
<div class="titleat">Account Type</div>
<input type="checkbox" value="Brick & Mortar Retailer" name="customer[note][BMR]" id="BMR" />
<label for="BMR" class="login labelark">Brick & Mortar Retailer</label>
<input type="checkbox" value="Online Retailer" name="customer[note][OR]" id="OR" />
<label for="OR" class="login labelark">Online Retailer</label>
<input type="checkbox" value="Rep/Distributor" name="customer[note][RD]" id="RD" />
<label for="RD" class="login labelark">Rep/Distributor</label>
</div>
<input id="Question" type="text" name="customer[note][Question]" placeholder="Question/Comment" />
<input id="arkpwd" type="password" placeholder="Password" value="" name="customer[password]">
<div class="input-wrapper">
<input type="submit" value="{{ 'customers.register.submit' | t }}">
</div>
{% endform %}
{% endif %}
当创建客户时,看起来form.posted_successfully?
没有设置为true。相反,你会得到一个"错误"提示:"我们已经发送了一封电子邮件到someone@example.com,请点击包含的链接来验证您的电子邮件地址"
您可能能够解析出错误字符串,以检测成功的表单提交。