Announcement

Collapse
No announcement yet.

Waitlist button using outOfStock function call

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Waitlist button using outOfStock function call

    Does anyone have success using the outOfStock function on Suivant? I have created a div block with an id 'js-waitlist-row' on the PROD page. I have the outOfStock function modify on the scripts page to include the id shown below


    function outOfStock() {
    var button = $('#js-add-to-cart');
    if (button.is(':disabled') == true) {
    button.addClass('bg-gray').val('Sold Out');
    $('#js-waitlist-row').show();
    } else {
    button.removeClass('bg-gray').val('Add to Cart');
    $('#js-waitlist-row').hide();
    };
    };


    When I select different variant, the add to cart button is disabled and changed to Sold Out but the div block doesn't appear. Is the condition correct or is there something wrong with the function?



Working...
X