Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2006
    Posts
    298
    Plugin Contributions
    0

    Default Display number of pending orders on main site

    I would like to be able to display for our customers how many orders we currently have in our processing queue. I tried the following query, but I must have something wrong. I can't determine why it's not showing the count. Can anyone help me sort this?

    Code:
    $query = "select count(*) as count from " . TABLE_ORDERS . " where orders_status = '114'"; 
    $result = mysql_query($query); 
    $values = mysql_fetch_assoc($result); 
    $num_rows = $values['total']; 
    echo $num_rows;

  2. #2
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Display number of pending orders on main site

    Quote Originally Posted by abcisme View Post
    I would like to be able to display for our customers how many orders we currently have in our processing queue. I tried the following query, but I must have something wrong. I can't determine why it's not showing the count. Can anyone help me sort this?
    Try this:

    Code:
     $query = "select * from " . TABLE_ORDERS . " where orders_status = '114'"; 
                    $result = mysql_query($query);
                     $count = mysql_num_rows($result) ;
      echo $count ;
    or this
    Code:
     $query = "select * from " . TABLE_ORDERS . " where orders_status = '114'"; 
    $num_rows_result = $db->Execute($query);
    $num_rows = $num_rows_result->RecordCount();
    Cheers
    RodG
    Last edited by RodG; 17 Feb 2015 at 04:54 PM.

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,474
    Plugin Contributions
    88

    Default Re: Display number of pending orders on main site

    Quote Originally Posted by RodG View Post
    Try this:

    Code:
     $query = "select * from " . TABLE_ORDERS . " where orders_status = '114'"; 
                    $result = mysql_query($query);
                     $count = mysql_num_rows($result) ;
      echo $count ;
    or this
    Code:
     $query = "select * from " . TABLE_ORDERS . " where orders_status = '114'"; 
    $num_rows_result = $db->Execute($query);
    $num_rows = $num_rows_result->RecordCount();
    Cheers
    RodG
    Definitely use the latter suggestion ($db->Execute) or your customization won't work with PHP 5.5 and later (when the mysql_* functions are deprecated, i.e. no longer included).

 

 

Similar Threads

  1. v150 Pending Credit Card Orders - Not posting orders after manual approval
    By CherVickers in forum Built-in Shipping and Payment Modules
    Replies: 20
    Last Post: 3 Jan 2015, 05:28 PM
  2. Site not giving order number or showing orders after payment
    By benm in forum PayPal Express Checkout support
    Replies: 4
    Last Post: 15 Feb 2011, 06:31 AM
  3. Pending orders
    By scorpio4646 in forum Managing Customers and Orders
    Replies: 6
    Last Post: 27 Aug 2009, 05:17 PM
  4. display model number on side box and main page
    By nishajh in forum General Questions
    Replies: 0
    Last Post: 17 Jun 2009, 06:27 AM
  5. Incorrect number of Pending Orders
    By mick9876 in forum General Questions
    Replies: 7
    Last Post: 21 Apr 2009, 12:05 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