How to create city selecting dropdowns on checkout page using checkout extension?

hasnain_malik
Shopify Partner
3 0 2

I have created Shopify checkout extension I want to make city field as option list when user select country Pakistan. I have already done this by using checkout liquid file but right now I have to implement it by using checkout extension. Please help me how can I make it possible. The SS is attached I want to implement exact same thing using checkout extension or suggest any other method.

Thanks

question.png

Replies 3 (3)

Liam
Shopify Staff
2723 289 741

Hi Hasnain,

 

It sounds like when you're building your checkout extension, you'll need to use the purchase.checkout.block.render target to add a custom element that performs in the specific way that you want. 
 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

hasnain_malik
Shopify Partner
3 0 2

The  purchase.checkout.block.render will render my checkout extension block although I want to customize by default city field in checkout form.

ShamiqTheDev
Shopify Partner
8 0 0

@Liam I am also looking for the same solution.

 

I want to overwrite the city input field with the searchable dropdown for specific countries.

Kind Regards,

Muhammad Shamiq Hussain
Team Lead Engineer
Engineering
Gaditek, SQUATWOLF