The case you have mentioned works, but I was talking about another case.
When a user creates an account, I added a “city” field to the registration form, but I don’t see it in the Shopify customer section, in the area you shared in the last screenshot.
Here is the code for customers/register.liquid
{{ 'customer.css' | asset_url | stylesheet_tag }}
#
{{ 'customer.register.title' | t }}
{%- form 'create_customer', novalidate: 'novalidate' -%}
{%- if form.errors -%}
##
{{ 'templates.contact.form.error_heading' | t }}
{%- for field in form.errors -%}
- {%- if field == 'form' -%}
{{ form.errors.messages[field] }}
{%- else -%}
{{ form.errors.translated_fields[field] | capitalize }}
{{ form.errors.messages[field] }}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- if form.errors contains 'email' -%}
{{ form.errors.translated_fields['email'] | capitalize }} {{ form.errors.messages['email'] }}.
{%- endif -%}
{%- if form.errors contains 'password' -%}
{{ form.errors.translated_fields['password'] | capitalize }} {{ form.errors.messages['password'] }}.
{%- endif -%}
{%- endform -%}
I’m not a developer, so unfortunately I can’t comment on your code or why it’s not working.
May you try to add this code under your code:
{{ ‘customer.addresses.city’ | t }}
>{{ ‘customer.addresses.country’ | t }}
What I do know is that Shopify does some dynamic validation of addresses which may be the reason you’re having a difficult time saving that data. For example, Shopify provides dynamic values for the State/Province field based on the input for the Country field. It’s also possible the Country data isn’t saving because it doesn’t exactly meet Shopify’s validation requirements.
So I think you can contact shopify support to check on that
@Ben1000 - The only way to add new fields to the customer registration form that sync to the Shopify Admin > Customers page is via the Shopify Admin API. Said another way, an app is required. Either a custom app or a ready-made third-party app.
We built the Customer Fields app to help bridge this gap, and it works seamlessly with customer addresses. This feature is available on the app’s Lite plan at just $12/mo.