In what cases BackInStockNotification is sent?

4 months ago
3.90
I have played with these feature and figured out that BackInStockNotification is sent only when I open a product and edit its stock manually and then save it. But it doesn't send any notifications whenever I cancel some old order and stock goes back to a product. Why is that? Why it doesn't work?
Also I have a plugin for purchasing and receiving stock. Whenever I update (receive) stock using that plugin then notifications also doesn't work.

Please, give me cases when BackInStockNotifications must work and in which cases it shouldn't work?

Are there any ways to fix this and force it send notifications whenever a product has stock again?
4 months ago
Please, someone reply?
4 months ago
In 3.90...
Only when an Admin edits the product (either individually or via bulk edit), and conditions are met (i.e., new stock quantity > 0 and previous quantity was <= 0) :
\Presentation\Nop.Web\Administration\Controllers\ProductController.cs
//back in stock notifications
if (product.ManageInventoryMethod == ManageInventoryMethod.ManageStock &&
    product.BackorderMode == BackorderMode.NoBackorders &&
    product.AllowBackInStockSubscriptions &&
    product.GetTotalStockQuantity() > 0 &&
    prevTotalStockQuantity <= 0 &&

    product.Published &&
    !product.Deleted)
{
    _backInStockSubscriptionService.SendNotificationsToSubscribers(product);
}


To have notification sent for any other 'workflow' would require customization.

4 months ago
New York wrote:
In 3.90...
Only when an Admin edits the product (either individually or via bulk edit), and conditions are met (i.e., new stock quantity > 0 and previous quantity was <= 0) :
\Presentation\Nop.Web\Administration\Controllers\ProductController.cs
//back in stock notifications
if (product.ManageInventoryMethod == ManageInventoryMethod.ManageStock &&
    product.BackorderMode == BackorderMode.NoBackorders &&
    product.AllowBackInStockSubscriptions &&
    product.GetTotalStockQuantity() > 0 &&
    prevTotalStockQuantity <= 0 &&

    product.Published &&
    !product.Deleted)
{
    _backInStockSubscriptionService.SendNotificationsToSubscribers(product);
}


To have notification sent for any other 'workflow' would require customization.



Now I understand. Thank you so much for your reply.