Have your say in Community Polls: What was/is your greatest motivation to start your own business?
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.

Checkout UI Extension Configuration: Add field type dropdown in admin

Solved

Checkout UI Extension Configuration: Add field type dropdown in admin

Shop_Tasker
Shopify Partner
5 0 8

Hi,

I know that, using configuration settings to add fields available in checkout components.
But, how can we add field type=> dropdown/choice?
I saw someone added this but in shopify documentation its not there.
https://shopify.dev/docs/api/checkout-ui-extensions/2024-04/configuration#supported-setting-types

image.png

Regards

Accepted Solution (1)

afaqmehmood
Shopify Partner
1 1 1

This is an accepted solution.

Hi, I don't know if its still useful, here is what I used.
I added this code is shopify.extension.toml file for the extension settings:
Example code:
[[extensions.settings.fields]]
key = "banner_title_limited"
type = "single_line_text_field"
name = "Banner title"
description = "Enter a title for the banner."
[[extensions.settings.fields.validations]]
name = "choices"
value = "[\"red\", \"white\", \"black\"]"

I hope this'll help you.

View solution in original post

Replies 4 (4)

JohnWF
Shopify Partner
16 0 5

Same question here. Must be undocumented but no idea how to get it happening.

afaqmehmood
Shopify Partner
1 1 1

This is an accepted solution.

Hi, I don't know if its still useful, here is what I used.
I added this code is shopify.extension.toml file for the extension settings:
Example code:
[[extensions.settings.fields]]
key = "banner_title_limited"
type = "single_line_text_field"
name = "Banner title"
description = "Enter a title for the banner."
[[extensions.settings.fields.validations]]
name = "choices"
value = "[\"red\", \"white\", \"black\"]"

I hope this'll help you.

Shop_Tasker
Shopify Partner
5 0 8

Yeah, it worked.
Thanks

JohnWF
Shopify Partner
16 0 5

Legend.