Shopify - Back In Stock Code Embed Location

  • 3 October 2022
  • 3 replies

Badge +1

We're working on speeding up our website.

Currently we have the restock notification form in our theme.liquid as per following this page:

Is that code able to be added just on the product page? As i think having it in theme.liquid causes it to load on places like the homepage too etc.

Just thinking if I can add it to product pages in Shopify OS2.0 as a liquid block as shown.

Will that work okay?




Best answer by Dov 4 October 2022, 15:57

View original

3 replies

Userlevel 7
Badge +61

Hi @ProteinPackage,

Thanks for sharing this question with our community.

This is an interesting question. You certainly can add the code into the discrete product files if wish, but I cannot say definitively if it will help speed up your site. 

Your best bet is to create a test Shopify store and Klaviyo account and use that as a staging environment for testing using the Back in Stock snippet in the product files and then evaluate the difference in speed.

I hope that’s helpful.


Badge +1

Hey @Dov 

Thanks for your reply. I have since added the restock script to our product page custom blocks instead of theme.liquid - can you kindly have a quick test on your side to see if it all works as it should for you?

Normal sold out product:

Variant sold out:


Userlevel 7
Badge +61

Hi @ProteinPackage,

Thanks for this update.

I’m afraid the community team is not equipped at this time to conduct tests on individual users’ websites.

For a second set of eyes on this, I recommend reviewing this with a member of our support team (if you’re using one of our support themes). If you are using a custom theme, I recommend reaching out to one of our wonderful partners for further assistance.

Thanks for being a community member.