Solved

Shopify App and App Theme Extension Integration

Douds_Man
Tourist
5 0 5

Hello Everyone,

I am new to development with Shopify. I have created an app using Node.js/React and have added an App Theme Extension to my app. I am wondering how I would go about updating my App Theme Extension based on changes within my App. For example, if an admin were using my app and entered some text into a textbox, would it be possible for this text to then update every block using my app to be updated with the input value? I have been trying to figure out how to allow my app to interact with the app theme extension, and have not been able to make this happen yet. Please let me know if this is possible/how to go about making this a reality.

Thanks!

Accepted Solution (1)

jagthedrummer
Shopify Partner
6 1 4

This is an accepted solution.

I think you'd want to have your app push that text value into a meta field on the shop or on a product, and then have your app extension liquid templates read from the meta field.

View solution in original post

Replies 5 (5)

jagthedrummer
Shopify Partner
6 1 4

This is an accepted solution.

I think you'd want to have your app push that text value into a meta field on the shop or on a product, and then have your app extension liquid templates read from the meta field.

den232
Shopify Partner
180 8 49

I have the exact opposite problem ...

 

I am developing an app theme extension and need it to be able to set a customer metadata. It cannot do that directly, as that requires admin API, so aI need a way to communicate from the extension to a webpage running on my infrastructure, which would contact the graphQL admin API to do the actual mutation to set the value of the metadata field.

 

How should I set up that webpage for access by the theme extension? I have installed node.js on my desktop (development server) and have a page which does the mutation, using fetch and express. However, express wants to set up a "server" using "listen", and I do not understand how my theme extension should interact with that "server".

 

App proxy? I can not seem to connect the dots.

 

Can you please direct me to some instructions that would get me past this hurdle? Assistance / direction would be much appreciated.

titungdup
Tourist
4 0 4

Hi @Douds_Man, did you found a solution to this? I am currently stuck in the same problem.

Douds_Man
Tourist
5 0 5

Currently, it does not appear that there is an easy way to reference content from the app within the app theme extension. The only way that this is possible that I am aware of is to create metafields and set the metafield values within the app. Then inside of the app theme extension, you will be able to reference the created/modified metafields from your app. 

titungdup
Tourist
4 0 4

The problem with metafields, AFAIK, is that it can only be added to predefined parts like products and we cannot create new parts to attach the metafields to. So you cannot add metafields that is not related to predefined parts by Shopify. For eg: if i want to add a text banner to the site i don't have any parts to add the metafield to.