App that embeds a custom JS script in the Checkout

Highlighted
Shopify Partner
2 0 1

I am working on building an app that is supposed to use a custom javascript script, that should be included in the checkout.

My initial approach was to build an app (NodeJS) that handles the OAuth part and once it is finished add a new ScriptTag that places the custom script inside the store. This was done and my script loads perfectly on all pages, but apparently custom scripts are allowed everywhere on the shop, except for the checkout.

However I assume there should be a way to do this, what would the best approach be in this scenario?

Your help is much appreciated! Thank you!

1 Like
Highlighted
Shopify Partner
4 0 1

Hey there, 

 

I'm searching for the same thing, did you find a way to do it by any chance ? 

 

Thanks to share if that's the case :) 

0 Likes
Highlighted
Shopify Partner
23 0 0

In the store settings -> Checkout, there is a field for adding additional scripts for the checkout page. However, I am not sure if you can inject code in this field through programming.

0 Likes
Highlighted
Shopify Partner
2 0 1
Hi,
As far as I was able to see this was not possible in the checkout itself.
My solution was to place the js script on the success page that is shown after order is successfully submitted.
This way I was able to perform an order update from there.
Hope this helps!
0 Likes
Highlighted
Shopify Partner
4 0 1

Hey, thanks for your reply. That's what I though, not possible on checkout. 

Can I ask how did you manage to put a script on the thank you page using an app ? 

 

Also, the goal of my app is to get a Javascript code, but I need to be able to get the data of the order. A bit like you can do in the backend, in the additional script textbox. You can use some liquid variables. 

 

Is it what you did ? 

 

Thanks so much in advance for your help, if you can :)

0 Likes