Home Forums WoodMart support forum Waitlist sends “Back in stock” emails before the product is published

Waitlist sends “Back in stock” emails before the product is published

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #724526

    boris.belica2
    Participant

    Hello XTemos team,

    First of all, thank you for the excellent theme and the Waitlist feature. While implementing it on one of our WooCommerce stores, we discovered a scenario where customers may receive the “Back in stock” email before the product is actually available for purchase.

    After investigating the Waitlist module, we believe this is not a bug in WooCommerce itself, but rather a logical edge case in the current implementation.

    Scenario

    Imagine the following workflow:

      A product (or one of its variations) is currently out of stock.
      Customers subscribe to the Waitlist.
      The store owner switches the parent product to Draft in order to prepare a new collection, update images, descriptions, pricing, etc.
      While the product is still in Draft, the stock quantity is updated from 0 to 10.
      The product is published a few minutes (or even hours) later.

    Current behaviour

    As soon as the stock changes to In stock, the Waitlist module immediately schedules the notification emails.

    Customers receive:

    “Good news! The product is back in stock.”

    However, the product is still Draft, therefore:

    it cannot be purchased,
    the product URL may return 404,
    or customers simply cannot access it.

    From a customer’s perspective, this is confusing because the notification arrives before the product is publicly available.

    __

    Expected behaviour

    The notification should only be scheduled when both conditions are satisfied:

    the product (or variation) is in stock;
    the product is published.

    For variations, the parent product should also have the publish status.

    If stock becomes available while the product is still a Draft, the notification should simply wait until publication.

    __

    Suggested solution

    Instead of simply cancelling the email, a deferred notification mechanism could be implemented.

    Suggested flow:

    When stock changes
    detect the product / variation becoming available;
    if the product is already published, schedule emails as today;
    otherwise mark the notification as pending.
    When the product becomes published
    verify that:
    the product is still published,
    it is still in stock,
    Waitlist subscriptions still exist,
    schedule the normal native Waitlist emails,
    remove the pending flag.

    This keeps the existing email templates, batching logic and Waitlist database completely unchanged while ensuring customers only receive notifications for products that are actually available.

    __

    Additional recommendation

    As a final safety layer, it may also be worth validating immediately before the email is sent that:

    the product still exists;
    the product is still published;
    the variation’s parent is published;
    the item is still in stock.

    This would also protect against race conditions or third-party inventory integrations

    __

    Tested solution

    To verify the concept, I created a custom PHP implementation that:

    supports simple products;
    supports variable products;
    supports individual variations;
    delays notifications while the product is a Draft;
    automatically sends them immediately after publication;
    preserves the existing WoodMart email templates;
    preserves the existing batching mechanism;
    prevents duplicate scheduled events.

    I have attached the implementation as a reference.

    Perhaps this behaviour could be considered for a future version of the Waitlist module, as I believe it would improve the user experience for stores that prepare products before publishing them.

    Thank you!

    #724527

    boris.belica2
    Participant

    php snippet

    #724570

    Aizaz Imtiaz Awan
    Keymaster
    Xtemos team

    Hello,

    We’ll consider how we can improve this functionality in future updates.

    Best Regards.

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)