WP Manifestindependent plugin directory
manifest / ecommerce / restock-alert-for-woocommerce

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.zip

A 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

  1. A customer visits an out-of-stock product page and sees a "Notify Me" form.
  2. They enter their email and submit — no account required.
  3. When the product is restocked (via WooCommerce admin or bulk update), every pending subscriber receives an email automatically.
  4. 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_status hook.
  • 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_subscribers table, 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

  1. Upload the restock-alert-for-woocommerce folder to /wp-content/plugins/.
  2. Activate the plugin from the Plugins screen in WordPress.
  3. WooCommerce must be active — the plugin will not load without it.
  4. The subscribers table is created automatically on activation.
  5. 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 on product_id and email for efficient querying at scale.
  • The notified_at timestamp 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