Forums / General Questions / Display product added/modified count in last 7 days in admin

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

Started by digitalshadow on 21 Jan 2015, 11:10 AM · Views: 563

Results 1 to 4 of 4
21 Jan 2015, 11:10 AM
#1
digitalshadow avatar

digitalshadow

Totally Zenned

Join Date:
Mar 2009
Posts:
616
Plugin Contributions:
0

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

I use this ```
$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
21 Jan 2015, 11:15 AM
#2
digitalshadow avatar

digitalshadow

Totally Zenned

Join Date:
Mar 2009
Posts:
616
Plugin Contributions:
0

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

In the catalog i have modified $new_range

$new_range = ' and (p.products_date_added >=' . $zc_new_date . ' or p.products_last_modified >=' . $zc_new_date . ')'; 

to show new and modified products

22 Jan 2015, 9:49 AM
#3
digitalshadow avatar

digitalshadow

Totally Zenned

Join Date:
Mar 2009
Posts:
616
Plugin Contributions:
0

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

anyone?

22 Jan 2015, 8:44 PM
#4
digitalshadow avatar

digitalshadow

Totally Zenned

Join Date:
Mar 2009
Posts:
616
Plugin Contributions:
0

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

<?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>';
?>