Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2009
    Posts
    609
    Plugin Contributions
    0

    Default Display product added/modified count in last 7 days in admin

    I use this
    Code:
    $products_stock = $db->Execute("select sum(products_quantity) as count from " . TABLE_PRODUCTS);
    to show current stock total, what I am after is a way to show what has has been added in the last 7 days.

    so some kind of where statement would be needed i presume, I've tried working the code myself, but I can't figure it out, hence why I am asking.

    Basically, I would like to be able to show how many products have been added or modified in the last 7 days and display that number in the admin.

    Thank you in advance

  2. #2
    Join Date
    Mar 2009
    Posts
    609
    Plugin Contributions
    0

    Default Re: Display product added/modified count in last 7 days in admin

    In the catalog i have modified $new_range

    Code:
    $new_range = ' and (p.products_date_added >=' . $zc_new_date . ' or p.products_last_modified >=' . $zc_new_date . ')';
    to show new and modified products

  3. #3
    Join Date
    Mar 2009
    Posts
    609
    Plugin Contributions
    0

    Default Re: Display product added/modified count in last 7 days in admin

    anyone?

  4. #4
    Join Date
    Mar 2009
    Posts
    609
    Plugin Contributions
    0

    Default Re: Display product added/modified count in last 7 days in admin

    PHP Code:
    <?php
     $products_added 
    $db->Execute("select count(*) as count, products_date_added, products_last_modified from " TABLE_PRODUCTS " where products_date_added >= DATE_SUB(CURDATE(), INTERVAL 1 WEEK) or products_last_modified >= DATE_SUB(CURDATE(), INTERVAL 1 WEEK)");
        echo 
    '<span>Current Stock Total: ' $products_added->fields['count'] . '</span>';
    ?>

 

 

Similar Threads

  1. Editing Shopping Cart Sidebox to display only last item added
    By shakes222 in forum General Questions
    Replies: 1
    Last Post: 26 Oct 2010, 05:23 PM
  2. Suddenly unable to login to admin area for last 3 days
    By mudguts in forum General Questions
    Replies: 5
    Last Post: 14 Dec 2009, 07:34 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