Creating a city dropdown selector on checkout page

Topic summary

An FMCG store in India is experiencing operational issues due to customers misspelling city names during checkout, causing problems with warehouse management, inventory systems, and delivery partners.

Goal: Create a dynamic city dropdown selector on the checkout page that populates based on the province/state selected by the user, similar to Shopify’s standard state dropdown functionality.

Current Status:

  • The original poster shared code snippets, but the formatting appears corrupted or reversed in several sections, making it difficult to parse the implementation details.
  • The code appears to relate to customer address management rather than checkout page modification.

Community Response:

  • Multiple users are asking for clarification on where to implement the code.
  • Questions focus on adding the city selector to either the payment page or shipping page.
  • No solutions or implementation guidance have been provided yet.

Discussion remains open with unanswered questions about proper code placement and implementation approach for the checkout customization.

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

Hey Devs , We are FMCG store that are operating in India .

Issue: We came to know many of our costumer are misspelling the city which create a chaos in Warehouse , inventory management platform and delivery partners.

Problem statement : Create a city dropdown on checkout page based on province selection by User

I am trying to create something like standard shopify checkout section state dropdown for city just that it should be based on state section

Code

{{ 'customer.addresses.title' | t }}

{% paginate customer.addresses by 10 %}

{% for address in customer.addresses %}

{% if address == customer.default_address %}{{ 'customer.addresses.default' | t }}{% endif %}

{{ address.street }}

{{ address | format_address }} {% if address.phone != blank %}
{{ address.phone }}

{% endif %}
{{ 'customer.addresses.edit' | t }}

{{ ‘customer.addresses.delete’ | t | delete_customer_address_link: address.id }}

{% form 'customer_address', address %}

{{ 'customer.addresses.edit_address' | t }}

{{ 'customer.addresses.first_name' | t }}
{{ 'customer.addresses.last_name' | t }}
{{ 'customer.addresses.company' | t }}
{{ 'customer.addresses.address1' | t }}
{{ 'customer.addresses.address2' | t }}
{{ 'customer.addresses.city' | t }}
{{ 'customer.addresses.country' | t }}
{{ 'customer.addresses.province' | t }}
{{ 'customer.addresses.zip' | t }}
{{ 'customer.addresses.phone' | t }}
{{ 'customer.addresses.set_default' | t }} {{ form.set_as_default_checkbox }}
{{ 'customer.addresses.cancel' | t }}
{% endform %}
{% endfor %}
{{ paginate | default_pagination }}
{% endpaginate %}
{% form 'customer_address', customer.new_address %}

{{ 'customer.addresses.add_new' | t }}

{{ 'customer.addresses.first_name' | t }}
{{ 'customer.addresses.last_name' | t }}
{{ 'customer.addresses.company' | t }}
{{ 'customer.addresses.address1' | t }}
{{ 'customer.addresses.address2' | t }}
{{ 'customer.addresses.city' | t }}
{{ 'customer.addresses.country' | t }}
{{ 'customer.addresses.province' | t }}
{{ 'customer.addresses.zip' | t }}
{{ 'customer.addresses.phone' | t }}
{{ 'customer.addresses.set_default' | t }}
{{ form.set_as_default_checkbox }}

{% endform %}

Where should I add this code? I want to add a city selector to the payment page. Can you help me?

1 Like

me too!

Where should I add this code? I want to add a city selector to the shipping page