Why isn't the updated newsletter form code working for first and last names?

Topic summary

A user is attempting to add first name and last name fields to a Shopify newsletter form, using code that previously worked in theme version 2.0. However, the same modifications are not functioning in version 30.1.

What was attempted:

  • Modified newsletter.liquid to include separate input fields for contact[first_name] and contact[last_name]
  • Added corresponding translations to en.default.json (“First Name” and “Last Name”)
  • Verified the JSON file is being read by successfully changing the email placeholder text

Technical details:

  • The form uses Shopify’s {% form 'customer' %} tag with a hidden newsletter tag
  • Each field includes proper attributes: name, placeholder, autocomplete, and labels
  • The code structure appears complete with field wrappers and animation settings

Current status:
The issue remains unresolved. The code modification that worked in the older theme version is not producing the expected first/last name fields in version 30.1, despite the translation file being correctly referenced. No responses or solutions have been provided yet.

Summarized with AI on November 11. AI used: claude-sonnet-4-5-20250929.

In 2.0 this worked to add first and last names, but if I change the code in a copy of 30.1 it doesn’t.

I changed the email place holder to prove I’m using en.default.json

Here’s the code that used to work

In newsletter.liquid

{% form 'customer', class: 'newsletter-form' %}
{{ 'newsletter.first_name' | t -}}
{{ 'newsletter.last_name' | t -}}
{{ 'newsletter.label' | t }} {% render 'icon-arrow' %}
{%- if form.errors -%} {%- render 'icon-error' -%} {{- form.errors.translated_fields.email | capitalize }} {{ form.errors.messages.email -}} {%- endif -%}
{%- if form.posted_successfully? -%}

{% render 'icon-success' -%} {{- 'newsletter.success' | t }}

{%- endif -%} {% endform %}
{%- endcase -%} {%- endfor -%}

In en.default.json

“newsletter”: {
“first_name”: “First Name”,
“last_name”: “Last Name”,
“label”: “Email”,
“success”: “Thanks for subscribing”,
“button_label”: “Subscribe”
},