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.

How to pass user settings to theme extension

How to pass user settings to theme extension

AbdelilahLbardi
Shopify Partner
9 0 1

Hey there,

 

I still can't my head around passing params to theme extension. My app uses Shopify App Bridge and appears in the Shopify admin panel, I save the user settings directly in my DB.

 

Let's say, I add a div with a text that is written by the shop owner when using the app. How can I make the theme extension to ping my server and get those settings for that shop in a secure way?

 

Thanks much

Reply 1 (1)

ViktorasssIT
Shopify Partner
6 0 1

Hi,
Struggling to figure out all of this stuff to.
To use data that is saved in your app, you have to use metafields.
Use shopify metafield API to save a value, then you can rended it inside the app-block.liquid, like so -> {{ shop.metafields.icon_block.layout }}
That's just an example how I saved the settings and displayed.
My issue is with displaying dynamic content inside the schema, so the user could change the settings value and save it also.
P.S
Did you manage to figure out this stuff?