Results 1 to 3 of 3
  1. #1

    Default Products quantity on order NOT ordered products quantity

    Hello, currently I am trying to show the products quantity on order right after $order->products[$i]['qty'] I want to see the exact quantity avaliable in stock.

    Something like this:

    Products Model Tax Price (ex) Price (inc) Total (ex) Total (inc)
    1 from 25 x Russell Hobbs RH18521 / 1800W RH18521 0% 99,00$ 99,00$. 99,00$ 99,00$

    The code I added to admin->orders.php is:

    PHP Code:
    <?php $products_qty_raw = ("select p.products_quantity,o.orders_products_id, o.products_id, p.products_id
                                    from " 
    TABLE_PRODUCTS " p, " TABLE_ORDERS_PRODUCTS " o                            
                                    where p.products_id = o.products_id
                                    and orders_id = " 
    . (int)$order_id ""
                                    
    );
                                    
    $pqty 'p.products_quantity';
                                    
    ?>
    and after that i used $pqty to show the current stock but nothing happens.

    Any help is Appreciated.
    My most recent work: magprom.net

  2. #2

    Default Re: Products quantity on order NOT ordered products quantity

    Mistery sold by me :)

    If anybody want the same thing it can be achieved by adding this line
    PHP Code:
     $products_qty_raw = ("select products_quantity, products_id 
                                    from " 
    TABLE_PRODUCTS "                            
                                    where products_id = " 
    $order->products[$i]['id'] . "" 
                                    
    ); 
            
    $pqty $db->Execute($products_qty_raw); 
    just before

    PHP Code:
    <td class="dataTableContent" valign="top">' . $order->products[$i]['name']; 
    and then put $pqty->fields['products_quantity'] wherever you want to show the product stock quantity on orders page.
    My most recent work: magprom.net

  3. #3
    Join Date
    Jul 2012
    Posts
    16,740
    Plugin Contributions
    17

    Default Re: Products quantity on order NOT ordered products quantity

    There's actually a ZC function that returns the quantity of a product remaining which if used becomes pretty much upgrade proof

    Code:
    echo zen_get_products_stock($order->products[$i]['id']);
    This of course provides an indication of quantity ordered related to current stock on hand, not necessarily the stock that was on hand when the order was made... Care should be taken to not end up over stocking the warehouse because of possible administrative mistakes.

    If reviewing orders weeks, months, etc. after the original order has been fullfilled, the additional information about current available quantity won't mean much.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. Replies: 1
    Last Post: 5 Aug 2015, 01:11 PM
  2. Bold word Quantity in products order page
    By rliddle in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 21 May 2012, 11:00 PM
  3. Products Quantity not working
    By barendfaber in forum Managing Customers and Orders
    Replies: 10
    Last Post: 16 Jan 2012, 04:53 AM
  4. Sort Order - Display Products by Quantity Available
    By calvinorr in forum General Questions
    Replies: 2
    Last Post: 18 Jan 2009, 01:19 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