Skip to main content
Solved

Programmatically trigger the 'back in stock' sign up form in Shopify


Forum|alt.badge.img+5

Hi,

I’ve implemented the BIS feature for my shopify store and it’s great. (https://help.klaviyo.com/hc/en-us/articles/360001895651)

Management have asked if the form can trigger whenever someone clicks an out-of-stock variant input, though. Out-of-the-box, the klaviyo BIS component changes the add to cart button into a ‘notify me’ button. Users have to then click this to show the form.

Is there anyway to rig the component to show the form when an out of stock size is clicked?

I have tried:

jQuery("div.product-form__controls-group input.disabled").on("click", function(){

    setTimeout(function(){ jQuery("a.klaviyo-bis-trigger").first().trigger("click"); }, 500);
    
  });

...and variations on this, and although console.log shows that a click event fires, nothing happens, so clearly it’s not a click event on the button that triggers the form. Hoping someone will say something like, ‘yeah, just invoke the klaviyo-bis.showForm() man, job done!’

Many thanks,

G

Best answer by Christiannoerbjerg

Hi ​@dartacus 

Thank you for posting in the Community!

I understand, that it’s frustrating! 

Could you please try the following? 

jQuery("div.product-form__controls-group input.disabled").on("click", function () {
  setTimeout(function () {
    const bisTrigger = document.querySelector("a.klaviyo-bis-trigger"); {
      bisTrigger.click();
    }
  }, 500);
});

Hope that helps! :-) 

Christian Nørbjerg Enger
Partner & CPO
Web: Segmento.dk
LinkedIn: @christianfromsegmento
Voldbjergvej 22b, 8240 Risskov

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

3 replies

Christiannoerbjerg
Expert Problem Solver II
Forum|alt.badge.img+14

Hi ​@dartacus 

Thank you for posting in the Community!

I understand, that it’s frustrating! 

Could you please try the following? 

jQuery("div.product-form__controls-group input.disabled").on("click", function () {
  setTimeout(function () {
    const bisTrigger = document.querySelector("a.klaviyo-bis-trigger"); {
      bisTrigger.click();
    }
  }, 500);
});

Hope that helps! :-) 

Christian Nørbjerg Enger
Partner & CPO
Web: Segmento.dk
LinkedIn: @christianfromsegmento
Voldbjergvej 22b, 8240 Risskov


Forum|alt.badge.img+5
  • Author
  • Problem Solver III
  • 63 replies
  • April 3, 2025

@Christiannoerbjerg nice one, works perfectly.


Christiannoerbjerg
Expert Problem Solver II
Forum|alt.badge.img+14

Hi ​@dartacus 

Amazing! Happy that it helped solved your problem! 

Have a nice day! :-) 

Christian Nørbjerg Enger
Partner & CPO
Web: Segmento.dk
LinkedIn: @christianfromsegmento
Voldbjergvej 22b, 8240 Risskov