Skip to main content
Problem Solver III
March 26, 2025
Solved

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

  • March 26, 2025
  • 3 replies
  • 253 views

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

    3 replies

    Christiannoerbjerg
    Expert Problem Solver II
    2025 Champion
    April 1, 2025

    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

    dartacusAuthor
    Problem Solver III
    April 3, 2025

    @Christiannoerbjerg nice one, works perfectly.

    Christiannoerbjerg
    Expert Problem Solver II
    2025 Champion
    April 3, 2025

    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