Have your say in Community Polls: What was/is your greatest motivation to start your own business?

how to create script tag that add custom button in cart page?

how to create script tag that add custom button in cart page?

rushikesh93
Excursionist
78 1 6

hello,
I have created an app using Shopify App Template - PHP,

Shopify php+reactjs app, but now I'm confused to create a script tag,

I don't understand how to create a script tag using Shopify App Template - PHP Structure,

exactly I don't understand which file I need to create that effect on the cart page.

 

I have read the script tag documentation, but don't get an exact idea about it,

I don't understand how to create a script tag, using Routes, Controller, and Component,

that the structure of this php App.

 

 

 

 

 

curl -d '{"script_tag":{"event":"onload","src":"https://example.com/my_script.js"}}' \
-X POST "https://your-development-store.myshopify.com/admin/api/2023-04/script_tags.json" \
-H "X-Shopify-Access-Token: {access_token}" \
-H "Content-Type: application/json"

 

 

 

 

 

I used this code and run into the Postman, it's run but, but now where does the output display in the front end?

in "src":"https://example.com/my_script.js", in src, which exact url i need to add?

because I'm developing this app in my local host.

 

please help me on this to create script tag.

 

Thanks.

 

@OneCommerce @PageFly-Victor @GemPages @flareAI @Alok_Kasgar 

Shopify Beginner.
Reply 1 (1)

rushikesh93
Excursionist
78 1 6

Please help me with this, give me some explanation on this.
Thank You.

Shopify Beginner.