how to get the app backend data into the store front with the script tag api.

Vikasrana36
Excursionist
19 1 0

Hello All

 

I am creating an app for shopify store and want to get the app input field data to frontend in the script tag api to show on the shop frontend. Is there any way to get the app fields on the store frontend with the script tag api ?

 

Please help with a example so that its clear to me how can I get the app input fields into the store front.

 

Thanks & Regards,

Vikas Rana

Replies 2 (2)

rohit_goel
Shopify Partner
11 1 5

For this just create an ajax call in shopify frontend on page load and url of that ajax call should be converted by proxy function which is a part of app section in partner's account

 

Follow below steps:

  • Go to Partner Account -> Apps -> Your App -> Extensions -> Manage extension areas -> Enable Online store
  • Go Back
  • Click on  Online store->App proxy -> Manage Proxy URL's
  • Write your function URL from which you want to return html at Proxy URL and write some specific keywork in Subpath let say "abcdef" and in Subpath prefix select any of the field let say "apps".
  • So by this the proxy url of that URL let say https://abc.com/specific_url into https://store_on_which_app_is_installed.myshopify.com/apps/abcdef

Now make document.ready call and return make ajax call on https://abc.com/specific_url and paste data on specific path.

 

 

 

Vikasrana36
Excursionist
19 1 0

Hi

 

Thanks for reply,

 I have tried like you said but nothing happans or may be I am not following the right way. lets take a simple example like showing instagram feed with the proxy url, I have set the fields for the instagram token and user id for my app backend and merchant put his token and userid into the text field and save the fields, now my question is how can I used this proxy url for getting those fields value and show instgram feeds onto the merchant store frontend with the js, so how can I proceed with this. I am used php for developing my app.

 

If you explain it to me with some example coding than I will be thankful to you.

 

Regards,
Vikas Rana