November 8, 2013

Magento Product stock back alerts (Out of Stock Notification) Not Working

Magento having a good process that if a product is out of stock then there should be a link for product notification. when the product back in stock it will send a mail to user.

To set up Magento Product Alerts please go to System > Configuration > Catalog > Product Alerts then select Yes to "Allow Alert When Product Comes Back in Stock" field.

Set out of status for any product and back to front end you see link to subscribe stock notify

Magento product stock back alert
Magento product stock back alert link

When user logged in and click to "Sign up to get notified when this product is back in stock" link, the user email will store in product alert table in Magento. Set in stock for this product in admin, an email will be send to user subscribed. Actually, email not send. Why????

After research I see config.xml file in Product Alert Module (app\code\core\Mage\ProductAlert\etc\config.xml) not set schedule for cronjob:

<crontab>
        <jobs>
            <catalog_product_alert>
                <run>
                    <model>productalert/observer::process</model>
                </run>
            </catalog_product_alert>
        </jobs>
  </crontab>
Just fix as well:

<crontab>
        <jobs>
            <catalog_product_alert>
                <schedule>
                    <cron_expr>*/5 * * * *</cron_expr>
                </schedule>
                <run>
                    <model>productalert/observer::process</model>
                </run>
            </catalog_product_alert>
        </jobs>
</crontab>


Bonus:


1.  Similar function to notify customer when product price changes
2. Custom design for Product stock back alerts function:

Magento product stock back alert custom design
Magento product stock back alert custom design



11 comments:

  1. Hi Toan,
    I have tried your solution, and actually records start to appear in the database under product_alert_stock table, and with values under "add date" and "sent date", so it looks okay from that part. Second i looked at cron_schedule and it shows several rows with a status of success, but i still don't get any messages!!!
    Do you have any suggestions what to do next?
    Thanks
    Miguel

    ReplyDelete
  2. @Miguel Tristao: You should set cronjob on your server with command: contab -e (CentOS)

    Find cronjob: /home/username/public_html/cron.php

    If not, please add command to cron:

    php -f /home/username/public_html/cron.php

    ReplyDelete
  3. Great Post!
    i m daily visitor of your blog & watch out your all post.I visited multiple websites but didn't find new content like this post..Yes!finally i read different news which i don't know,thanks
    Equity Tips

    ReplyDelete
  4. I use a special extension for that (http://amasty.com/out-of-stock-notification.html), the best think is that it's easy and requires no coding.

    ReplyDelete
  5. I know this is one of the most meaningful information for me. And I'm animated reading your article. But should remark on some general things, the website style is perfect; the articles are great. Thanks for the ton of tangible and attainable help. mopping robots

    ReplyDelete
  6. No doubt this is an excellent post I got a lot of knowledge after reading good luck. Theme of blog is excellent there is almost everything to read, Brilliant post. www.qatarbusinesscouncil.org

    ReplyDelete
  7. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. Great work. achat d'un produit par un particulier

    ReplyDelete
  8. From complex workplaces to specialized challenges, and bolster administrations, Diane Keaton Anti Aging Products numerous variables impact a product structure.

    ReplyDelete
  9. This list illustrates the wide array of options you get using this widely popular eCommerce platform. Just consider some of its advantages:
    WordPress web design

    ReplyDelete
  10. what is */5 * * * *
    what is */5 * * * *
    please explain

    ReplyDelete
  11. I just want to let you know that I just check out your site and I find it very interesting and informative.. intraday tips

    ReplyDelete