Hello Summer Sale!
Exclusive season-opening discount on TheGem theme.
Limited time offer.

Okay
  Public Ticket #4108938
Out of stock button
Closed

Comments

  • llukamatej2004 started the conversation

    Hello, 

    Is there a way to add a button that will show up when the product goes out of stock so that customer can send an inquiry about the product? 

  •  7,280
    Oliver replied

    Hi, thank you for your request. 

    You can check one of the following plugins: 

    https://wordpress.org/plugins/waitlist-woocommerce/

    https://wordpress.org/plugins/gm-woocommerce-quote-popup/ 

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  • llukamatej2004 replied

    Hello I found a different solution 

    i created additional button and gave it a unique ID and also created a seperate pop up with its own trigger

    here is the js if anyone ever has the same problem 


    document.addEventListener("DOMContentLoaded", function() {
        var stockElement = document.querySelector(".stock.out-of-stock");
        var button = document.getElementById("inquiry-button");
        
        if (button) {
            if (stockElement) {    
                button.style.display = "inline-block";
            } else {
                button.style.display = "none";
            }
        }
    });

  •  7,280
    Oliver replied

    Hi, thank you for letting me know!

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver