Skip to main content
Solved

Back in stock button not showing up when selecting variant shopify

  • February 5, 2025
  • 1 reply
  • 10 views

Forum|alt.badge.img

Hi all,

We've been using Klaviyo's back-in-stock functionality for about a year now, and it has worked really well. However, we now need to upgrade our 'Prestige' theme since it has been a while since our last update.

After updating, I wanted to check if everything was still working properly, but I noticed that the back-in-stock button doesn't appear when selecting an out-of-stock variant. It does show up when the page initially loads, but if I select a different variant and then go back to the out-of-stock one, the button doesn’t reappear. When switching it only shows the sold out button.

We've added the exact same script as before, but unfortunately, it’s not working.

Our preview store URL with the updates version is: https://iakjl0i30483c5ja-81196679476.shopifypreview.com 

You can search for Jamie Col Knit Bordeaux to see an out of stock variant. 

Has anyone encountered this issue before or found a solution? Any help would be greatly appreciated!

 

 

 

Best answer by MANSIR2094

Hello ​@sebashobo , 

This issue is likely due to how your updated Prestige theme handles variant changes with JavaScript. The back-in-stock button isn't reinitializing when switching variants.  

Solution: Try placing Klaviyo’s back-in-stock script inside a function that re-runs on variant change. In `theme.js` (or a similar file), locate the variant change event and call the Klaviyo script again when a new variant is selected.  

If the issue persists, checking for JavaScript errors in the browser console can help pinpoint conflicts. Let me know if you need further guidance!  

View original
Did this topic or the replies in the thread help you find an answer to your question?

1 reply

MANSIR2094
Problem Solver IV
Forum|alt.badge.img+13
  • Problem Solver IV
  • 174 replies
  • Answer
  • February 5, 2025

Hello ​@sebashobo , 

This issue is likely due to how your updated Prestige theme handles variant changes with JavaScript. The back-in-stock button isn't reinitializing when switching variants.  

Solution: Try placing Klaviyo’s back-in-stock script inside a function that re-runs on variant change. In `theme.js` (or a similar file), locate the variant change event and call the Klaviyo script again when a new variant is selected.  

If the issue persists, checking for JavaScript errors in the browser console can help pinpoint conflicts. Let me know if you need further guidance!