Additional Scripts don't load until page refresh

Hi! I’ve added some custom scripts to my order status page (the Thank You page upon completed checkout), and i’m having issues (everything loads correctly, but only after a page refresh so i don’t think it’s an error in my code)

That being said, if i simply add something like:

Shopify.Checkout.OrderStatus.addContentBox('test');

it works fine on the initial page load.

But if i add what i need in there:


It doesn’t load the content boxes until i refresh the page (unless of course i access the page from orders>Order Status page)

So it works with this URL format: https://mysite.com/61052518618/orders/31ebba0e2fa2f7f9ae62d1d6b50ca88b

But not with the initial URL: https://mysite.com/checkouts/c/f5d7dac489b8003c4bd56a551dde732c/thank_you

Why doesn’t it work on the /thank_you page? And is there a way to fix it? Thanks!!

2 Likes

Having exact same issue. It is surprising that the support did not post any comment on this. Its been more than 2 months I see.

Let me know if you found any solution for this.

Hey,

I just found a workaround for this. Sharing it here so anyone does not run after shopify support.

Just add this script with your script.

Bumping this. It seems scripts don’t load on the Thank you page.

Also, refreshing the Thank you page does not redirect to Order Status page anymore.

Seems its works fine for me.

1 Like

You’re right! It wasn’t working in my development store with test purchases, but when I tested it on my production store with real money it worked.

Thanks for the reply.

1 Like