Restock Alert for WooCommerce
Restock Alert for WooCommerce
by Imran Hosain · github.com/imran-hosain/restock-alert-for-woocommerce · website
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/imran-hosain/restock-alert-for-woocommerce/archive/refs/heads/main.zipA lightweight WooCommerce extension that lets customers sign up to be notified by email when an out-of-stock product is back in stock — capturing demand that would otherwise be lost.
How it works
- A customer visits an out-of-stock product page and sees a "Notify Me" form.
- They enter their email and submit — no account required.
- When the product is restocked (via WooCommerce admin or bulk update), every pending subscriber receives an email automatically.
- Store owners can view all alerts and export subscriber data from WooCommerce → Restock Alerts.
Features
- Notify Me form — appears automatically on out-of-stock product pages, no theme editing required.
- Instant email on restock — fires as soon as a product's stock status changes to "in stock" via the
woocommerce_product_set_stock_statushook. - Duplicate prevention — the same email can't subscribe to the same product twice while a pending alert exists.
- Admin dashboard — tabbed interface under WooCommerce showing pending/notified counts, subscriber list, and export.
- CSV export — download all subscriber data in one click.
- Customizable email — subject line and body editable from the Settings tab, with
{product},{url}, and{site}template tags. - Custom fallback redirect — choose where orphaned attachment visitors land (unrelated to this plugin's core feature, part of the broader toolset).
- Custom DB table — subscriber data is stored in a dedicated
wp_rafw_subscriberstable, indexed by product and notified status, rather than in postmeta. - Clean uninstall — the subscribers table is dropped only on full plugin deletion, never on deactivation.
Installation
- Upload the
restock-alert-for-woocommercefolder to/wp-content/plugins/. - Activate the plugin from the Plugins screen in WordPress.
- WooCommerce must be active — the plugin will not load without it.
- The subscribers table is created automatically on activation.
- Go to WooCommerce → Restock Alerts to view subscribers and configure email settings.
Requirements
- WordPress 6.0+
- WooCommerce 7.0+
- PHP 7.4+
Admin UI
The plugin ships with a custom-built admin dashboard styled to complement WooCommerce's own UI:
- Alerts tab — pending/notified stat cards, subscriber table with product links and status badges, CSV export
- Settings tab — button text, email subject, and email body customization with template tag support
- Instant client-side tab switching (no page reload)
Email template tags
| Tag | Replaced with |
|---|---|
{product} |
Product name |
{url} |
Product page URL |
{site} |
Site name |
Development notes
- Subscriber data uses a custom table (
wp_rafw_subscribers) with indexes onproduct_idandemailfor efficient querying at scale. - The
notified_attimestamp prevents any subscriber from receiving duplicate emails across multiple restock cycles. - AJAX nonce verification on every form submission.
- Frontend CSS/JS loads only on single product pages (
is_product()check). - Follows WordPress Coding Standards throughout.
License
GPL v2 or later. See LICENSE.
Author
Imran Hosain — WordPress & WooCommerce Developer