Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2009
    Location
    Simi Valley, CA
    Posts
    100
    Plugin Contributions
    0

    Default Warning: Low Stock emails

    I have my site configured to send a low stock warning email (which is very important) when the product dips below 5,000. The problem is that it sends that warning every time an order is placed.

    What can I do to configure it so that the email is just sent once when the product is below 5,000?

    Zen V: 1.3.8

    Thanks so much!

    MC

  2. #2
    Join Date
    Jan 2004
    Posts
    66,391
    Blog Entries
    7
    Plugin Contributions
    81

    Default Re: Warning: Low Stock emails

    You'd have to write custom code to set some sort of flag in the database saying that notification has already been sent, and then check for that flag before emailing ... and then when you restock the items you'll have to be sure that you reset that flag or else you'll not be notified again.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Feb 2009
    Location
    Simi Valley, CA
    Posts
    100
    Plugin Contributions
    0

    Default Re: Warning: Low Stock emails

    Challenging! I will try to do this.

    I will start by looking at script in this file:
    /includes/classes/order.php

    I got here because I looked up in the developer's tool kit: EMAIL_TEXT_SUBJECT_LOWSTOCK.

    Thanks for guidance Dr. Byte - am I on the right path?

    MC

  4. #4
    Join Date
    Feb 2009
    Location
    Simi Valley, CA
    Posts
    100
    Plugin Contributions
    0

    Default Re: Warning: Low Stock emails

    I think it is somewhere around here in order.php

    if ($this->email_low_stock != '' and SEND_LOWSTOCK_EMAIL=='1') {
    // send an email
    $email_low_stock = SEND_EXTRA_LOW_STOCK_EMAIL_TITLE . "\n\n" . $this->email_low_stock;
    zen_mail('', SEND_EXTRA_LOW_STOCK_EMAILS_TO, EMAIL_TEXT_SUBJECT_LOWSTOCK, $email_low_stock, STORE_OWNER, EMAIL_FROM, array('EMAIL_MESSAGE_HTML' => nl2br($email_low_stock)),'low_stock');
    }

    (line 939)
    I need help on how to create a DB flag. I don't know how. But, I think I need to add another conditional stmt after :SEND_LOWSTOCK_EMAIL=='1'.

    something like: "and db_flag== 1".

    Would this work?

    Thanks for all your help.

    MC

 

 

Similar Threads

  1. v151 Strange behavior with Warning: Low Stock email
    By woodlandsprite in forum General Questions
    Replies: 3
    Last Post: 28 Nov 2012, 03:51 AM
  2. Warning: Low Stock
    By dealbyethan.com in forum Basic Configuration
    Replies: 13
    Last Post: 22 Jul 2011, 08:09 PM
  3. Warning Low Stock Emails coming with all orders.
    By samar777 in forum General Questions
    Replies: 5
    Last Post: 31 Aug 2010, 09:00 PM
  4. "Warning: Low Stock": How do I get rid of this?
    By zcnb in forum Customization from the Admin
    Replies: 9
    Last Post: 30 Jun 2008, 04:01 AM
  5. Product Low Stock Emails - One per or all in one?
    By StevenB in forum General Questions
    Replies: 2
    Last Post: 12 May 2007, 04:50 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR