Sahan Pasindu Nirmal
Sahan Pasindu Nirmal

Reputation: 443

Manage "Low stock threshold" at Woocommerce products variations

I need to manage the "Low stock threshold" at Woocommerce products variations level, But default plugin (Woocommerce) does not have this functionality on product variations level.

It has a global level stock management Low stock threshold. But this is not what I want, because of my web full of variable/variations product. So I looking for a solution because I need to get notification about each product variation notification email when it hit the low stock threshold which I want to give.

Does anyone have a better suggestion for my problem?

Thanks

Upvotes: 0

Views: 1846

Answers (1)

Colin Laws
Colin Laws

Reputation: 680

It appears that WooCommerce allows for you to create webhooks for multiple types of events within their system. You can set up a webhook to send your app a request whenever any of the following events occur:

  • Product created
  • Product updated
  • Product deleted

Here is a link to WooCommerce webhook documentation.

Essentially, you could use a webhook to notify your app when the stock of a particular product falls below your desired threshold. To do this, you would need to store a copy of the product in your own database, along with the threshold you want to be alerted at. If you received a webhook for 'Product updated' for when the stock level changes, you could write logic in your application to check your stock level you have set, and respond accordingly (such as a notification to an admin, an email, etc.).

Here is a helpful article on setting up webhooks with WooCommerce.

Hopefully I have understood your problem correctly, and the setup you are implementing.

Upvotes: 2

Related Questions