Wordpress WooCommerce - 在 PHP 或脚本中监听产品何时重新有库存(从 0 库存数量到 1)
当产品库存数量从0更改为1时,我是否可以使用一个函数来收听?当产品恢复库存时,我想致电Firebase端点(发送推送通知)。我应该写一个PHP功能还是制作自己的插件?还是我应该在C#中制作脚本?
谢谢!
Is there a function that I can use to listen when a product stock quantity is changed from 0 to 1? I want to call a firebase endpoint when the product is back in stock (send a push notification). Should I write a PHP function or make my own plugin? Or should I make a script in C#?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用的 2 个操作挂钩是“woocommerce_product_set_stock”和“woocommerce_variation_set_stock”,
您可以将其放置在主题中
functions.php
2 action hooks I use are 'woocommerce_product_set_stock' and 'woocommerce_variation_set_stock'
you can place this in your theme
functions.php