App reviews, troubleshooting, and recommendations
Hello,
I have written some JavaScript code that redirects new users to the checkout page after they've created an account. I'm currently using this piece of code in all 5 Shopify stores I own. I would like to create an app that simply pastes the JavaScript code in the index.liquid, login.liquid and accounts.liquid files of whatever store it's installed in.
I'm not that much of a programmer but I'm pretty good at finding pieces of code online and meshing them together to get them to do what I want. I've already set up a basic Shopify App that displays information and I've installed it on a development store using this guide https://shopify.dev/tutorials/build-a-shopify-app-with-node-and-react
Now what I would like to do is have the app automatically paste the JavaScript code in the index.liquid, login.liquid & accounts.liquid when it's installed to a store. Any help on how I can do this?
Hey @EphraimMulilo
best way to start is to look at the docs on shopify.dev
The docs are pretty extensive. But basically what you want to do is when the app installs, access each one of those specific files using the Admin API and the Themes endpoint. https://shopify.dev/docs/admin-api/rest/reference/online-store/asset
Each of the liquid files are Assets. So just look up each one and make the changes to the value. Pretty easy!
Hey!
i had a similar use case, what i am trying to do is, when user installs my app, in page, i would ask for a token from user, which i will use in a static js code which is just an embed script. I then need to add this embed script to user's main theme.liquid file's header. Can you please guide me a bit, i am currently done with the frontend part. Still stuck in the backend flow
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023