add iframe to page from shopify app

Highlighted
New Member
5 0 0

Hi all

I create a Shopify app with the cli (React and nodejs).

can I add iframe to a product page from the code? 

for now, I'm updating the product images from my app but I want also to add iframe. 

can I do it? 

 

Thanks. 

0 Likes
Highlighted
Shopify Partner
70 7 24

@maorZeekit ,

 

Probably look at the Script Tag API. This allows you to add functionality to pages. I think that should help you.

 

GMKnight.

Store owner and app developer. Canada.
0 Likes
Highlighted
New Member
5 0 0

thank you for the replay but I can't understand anything. 

 

for using the script Tag API I need an API key and password? so I  need to take them from my partner account or from the store? from where do I take the key and password? 

I don't understand why there is graphQL API and reset API or how can I add changes to the store from my app. 

0 Likes
Highlighted
New Member
5 0 0

OK, I figure it out but when am I using scriptsTagCreate how can I use a local JS file? 

0 Likes
Highlighted
Shopify Partner
70 7 24

Hi @maorZeekit ,

 

When you create a ScriptTag, one of the parameters is 'src' (you also have 'event' and 'display_scope'). 

You can refer to a vanilla JS file served from your server, for example. This will be loaded based on the event.

This is effectively your 'local' JS file. Make sure it's in a closure.

This is a good article: https://shopify.dev/tutorials/include-javascript-in-shopify-themes

 

GMKnight.

Store owner and app developer. Canada.
0 Likes