Hello there,
Good Day!!
We’re here to assist you.
We would like to inform you that, as of now, subscribers are required to resubscribe to the same product each time it goes out of stock if they wish to receive an in-stock notification when it becomes available again in order to ensure sending notifications only to those who are actively interested in the product at the time it comes back in stock.
Thanks.
Is this something that could be changed, as subscribers can easily ‘unsubscribe’ when they have or don’t need any more supplies, where as having to re-subscribe each time the item goes out of stock again is a bit annoying for them, and something most people wont think to do.
I have a high demand product with many subscribes, and only small quantities available at a time
Hello there,
We’re sorry for your inconvenience. Our plugin is not intended to send emails continuously, but it has the flexibility to keep informing subscribers about products that are back in stock. We shared the below code, which does the trick.
Please put the below code either in theme functions.php or child theme functions.php and check it out.
function cwg_instock_change_post_status($new, $old, $post) {
$post_type = $post->post_type;
if ('cwginstocknotifier' == $post_type) {
if ($new == 'cwg_mailsent' && $old == 'cwg_subscribed') {
$obj = new CWG_Instock_API();
$obj->subscriber_subscribed($post->ID);
}
}
}
add_action('transition_post_status', 'cwg_instock_change_post_status', 10, 3);
Let us know.
Thanks.