Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2011
    Posts
    48
    Plugin Contributions
    0

    Default How do I add text to the product name if out of stock when ordered?

    Hello. Been trying to figure this one out on my own for a little bit but I'm having trouble. If someone can point me to the location of the SQL queries that create the order, I should be able to get it done.

    Basically, I want to add an asterisk (*) to the front of the `products_name` in the `zen_orders_products` table for any products that are not in stock at the time of that order. Basically, if the quantity ordered is more than the quantity in stock, I want the `products_name` to have the asterisk at the front.

    The below paragraph is completely irrelevant to the problem so no need to read it unless you want to know why I want this function.

    When ordered inventory comes in, we don't put it away since most of it is going right back out. This way my guys will know it was a special ordered item and they can look in the boxes that just came in for those items. I use the "low stock" function to have the cart send me emails when an item drops below zero so that I know to order it in and that works great, but if I can flag these items on the actual packing slip it will greatly speed up the order filling process. It will also help if a customer contacts us and wonders where his order is or why it hasn't shipped. We can take one look and see that an item was special ordered. As we all know, customers don't always read the giant red letter warnings that tell them important information. All our items that are not in stock are flagged as ***SPECIAL ORDER*** in the cart but people still order and then email the next day wondering why their order hasn't shipped. Makes me laugh, but it's also frustrating.

    THANKS IN ADVANCE!!!
    Last edited by Lanbo; 23 Oct 2013 at 09:07 PM. Reason: clarification

  2. #2
    Join Date
    Dec 2011
    Posts
    48
    Plugin Contributions
    0

    Default Re: How do I add text to the product name if out of stock when ordered?

    So I seem to answer my own questions after I post them. Oh well, at least I remember to share with others this way.

    I was able to get exactly what I wanted by adding this to the end of the "for loop" inside the "function create_add_products".

    Code:
    // Flag special order items with *
    if ( $stock_left <= STOCK_REORDER_LEVEL )
         {
         $db->Execute("update " . TABLE_ORDERS_PRODUCTS . " set products_name = concat('*',products_name) where products_id = '" . zen_get_prid($this->products[$i]['id']) . "' AND orders_id = '" . $zf_insert_id . "'");
         }

 

 

Similar Threads

  1. v154 How can I add the image of an ordered product?
    By alex369 in forum Managing Customers and Orders
    Replies: 6
    Last Post: 8 Sep 2015, 05:28 PM
  2. Stock by Attribute setup and product has stock when added to card says out of stock
    By kwrosenzweig in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 9 Jun 2011, 06:18 PM
  3. Customer Ordered Out of Stock Disabled Product!
    By renner in forum Managing Customers and Orders
    Replies: 33
    Last Post: 13 Jul 2010, 10:49 AM
  4. when buying product how to add text
    By speed in forum General Questions
    Replies: 1
    Last Post: 1 Jun 2008, 12:36 AM
  5. Add 'out-of-stock' text to product description list
    By leeudon in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 27 Jun 2007, 03:53 AM

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