• dr3wsephs

    (@dr3wsephs)


    I left my previous message below. We the code given, it works amazing. Plugin is great with no bugs that I have come across as of yet! Definitely a plugin to get if you need to let your customers know products are back in stock.

    Honestly, the premise of this plugin is to continuously send out emails to people who are subscribed to out of stock products… this however does not. If the user subscribes and then the product comes back in stock, they will get only ONE email… once. So, if the product goes out of stock again, they will not get another email once it comes back in stock again.

    • This topic was modified 2 years ago by dr3wsephs.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support CodeWooGeek Support

    (@codewoogeeksupport)

    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);

    If you feel the above code works the way you expect, then please edit your existing review.

    Let us know.

    Thanks.

    Thread Starter dr3wsephs

    (@dr3wsephs)

    I’ve tested it and it works. Thanks! I went ahead and changed my review.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Works as Expected – Extra Code makes it better!’ is closed to new replies.