Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Hide existing fields in checkout. (Location Field)

Hide existing fields in checkout. (Location Field)

Areesh
Shopify Partner
2 0 0

Hi, I am transfering my custom code in checkout.js  to my custom app for customizing my checkout.  Currently I created 3 fields which is "Province, City, Barangay". This fields are dropdown, the behaviour of this is when this fields are selected, the other field will showcase options related to the selected field. 

The pattern will be Province > City > Barangay. 

Now the nextstep will be: I need to hide the existing fields in checkout which is the  "Region & City".
 
See Below image for reference:
Screenshot 2024-07-31 at 4.33.36 PM.png

And also I want the result structure to be like this:
Screenshot 2024-07-31 at 4.38.54 PM.png

How will I able to achieve this?

Thank you!

Replies 2 (2)

Liam
Community Manager
3108 344 910

Hi Areesh,

 

From your description, it sounds like you'll need to create a checkout UI extension using the purchase.checkout.delivery-address.render-before target. There is a video here that shows how to get started building these out. 

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

Areesh
Shopify Partner
2 0 0

Hi Liam, 

Thank you for this,  I have applied the checkout UI Extension and purchase.checkout.deliver-address-render-before target. But is it possible to put my custom fields between the pre-defined fields of checkout? 

Screenshot 2024-08-01 at 6.00.35 PM.png
is this possible? Thank you