A Shopify store owner seeks to automatically replace the “Pay with PayPal” button with a “Notify Me” button when products are out of stock on a third-party theme.
Key Requirements:
Reliable functionality across all page loads and variant changes
Prevent accidental triggering of out-of-stock actions
Eliminate button flashing during variant switches (currently “Notify Me” briefly appears even when items are in stock)
Display a popup when “Notify Me” is clicked
Proposed Solutions:
Code-based approach: Use conditional logic (if/else) to toggle button visibility based on variant.available status. A JavaScript snippet was provided using variant:change event listeners to update buttons instantly and prevent flashing by pre-hiding the “Notify Me” button in HTML.
App solution: STOQ back-in-stock alerts app was recommended as a ready-made alternative, offering instant loading, reliable variant tracking, customizable popup options, and support to prevent PayPal button flashing.
Current Status: The original poster attempted implementing the custom code unsuccessfully and requested direct implementation assistance. The discussion remains open with no confirmed resolution.
Summarized with AI on October 29.
AI used: claude-sonnet-4-5-20250929.
I’m working on a Shopify site using a third-party theme, and I’m trying to automatically replace the “Pay with PayPal” button with a “Notify Me” button whenever a product or variant is out of stock. Here’s what I need it to do:
Work reliably on every page load and variant change
Ensure that clicking the “Notify Me” button doesn’t trigger the out-of-stock functionality by mistake
Improve response time: currently, on variant switch, the “Notify Me” button sometimes flashes briefly even when the product is in stock and PayPal buttons load afterward
My main goal is to keep the same functionality, but make the button update faster and more smoothly.
Also, when someone clicks “Notify Me”, I want a popup to appear. If anyone has a good approach for this, I’d be happy to share the code I’ve been working with!
Hey @Leon09 We got you covered on STOQ - our app for back in stock alerts & preorders. Worked with tens of thousands of merchants over the last 3 years on exactly the type of flow you’re looking for.
STOQ tracks variant changes and works extremely reliably on all page loads.
Clicking our “Notify me” button won’t trigger any add-to-cart flow.
Our button loads pretty much instantly, and we can have it so that your Paypal button never flashes/appears through some additional custom code.
With STOQ, you can set it up so customers see a popup when they click “Notify me” or you can show the popup directly on the page to improve conversion to signup.
We have a generous free plan and 24*7 support. Let me know if you have any questions or if there’s anything we can do to get you set up.