Solved

Triggering Back in Stock before inventory reaches zero

  • 17 November 2020
  • 5 replies
  • 348 views

Badge +1

Howdy folks,

We’re implementing back in stock for a client on Shopify and of course it works perfectly for them.  When stock equals zero the sold out button appears and the BIS button is displayed.  However, our client now wants to show the back in stock button when their inventory is at 3 or less.  This allows them to avoid over selling and keeps them ahead of their stock levels. 

 

My approach to implementing this was to physically implement the BIS button in the product template when inventory <= 3:

{% if stock_available <= 3  %} 
<a class="klaviyo-bis-trigger" href="#">Notify Me When Available</a>
{% endif %}

 

Of course, this does display the BIS button but the actual triggering of various JavaScript elements does not occur as Klaviyo.js is listening out for stock levels to equal 0 before working it’s magic.  Does anyone know how I can override the stock level threshold so Klaviyo’s back in stock functionality kicks in when stock is less than or equal to 3?

 

Great so see the forum getting so much action already!

 

Loughlin.

icon

Best answer by Dov 12 October 2021, 22:24

View original

5 replies

Badge +1

Hey, I got this working - for those interested I overrode the getProductJSON function in onsite.js to report a false value for the inventory (i.e. 0 when it was 2).  Works :)

Userlevel 6
Badge +8

Hi @milkbottlelough - thanks for asking your first question AND sharing your first answer all in one post! Glad to hear that you were able to override and get this working, and thanks for filling the rest of us in.

Badge +1

Hey there, since posting this approach we have noticed it has been problematic and I would not recommend messing around with the onsite.js JavaScript file that Klaviyo injects into your page.

We’ve noticed issues with how BIS works and how the button operates when “tricking” Klaviyo into thinking the item is sold out when in fact there is still stock available.

 

Maybe someday Klaviyo will include a threshold setting to determine when stock is approaching 0 and show the BIS button then but alas this is currently not an option (as of May 2021 anyway).

Hello,

We are also trying to implement this on a Shopify store. We want to display “Notify Me When Available” button when the inventory count hits 10.

Has anyone in the community found a solution for this? Or has Klaviyo added any new configuration on there end which can help us to achieve this?

 

Thank You

Userlevel 7
Badge +55

Hi @Vik,

Thank you for sharing this with the Klaviyo community.

Currently, Klaviyo does not have a method to achieve this because our code is designed to only trigger “Notify Me When Available” when inventory reaches 0. With that said, we do have the ability to control other back in stock sending settings.

There are two key settings you can adjust regarding your back in stock flow:

  • Minimum inventory rules
  • Customer notification rules
     

Minimum inventory rules refer to how many items need to be restocked before you notify those who subscribed.

Customer notification rules have two sub-settings that work together to customize how many and how frequently to send back in stock messages. 

For more information on these topics, I recommend reviewing our documentation on them here.  

Additionally, I have filed a feature proposal to see if we can potentially build out your requested feature in the future. Of course also open to other suggestions user’s have on this topic :)

Thanks for being a member of our community.

Dov

Reply