Here you go for 4.4.2!!!
Here's what you do.
1. BACKUP ANY FILES YOU CHANGE.....
2. Make a copy of your admin/orders.php file, rename this copy to orders30.php
3. Open up orders30.php and find the line:
Code:
x_session_register("search_data");
AFTER that line insert:
Code:
# BCSE
if(!empty($search_data[orders]))
unset($search_data[orders]);
$search_data[orders][sort_field] = 'orderid';
$search_data[orders][sort_direction] = 1;
$search_data[orders][by_username]='on';
$search_data[orders][by_firstname]='on';
$search_data[orders][by_lastname]='on';
$search_data[orders][date_period]='T';
$search_data[orders][status]='';
$mode="search";
# BCSE
4. Open up include/orders.php and find this code:
Code:
} elseif ($data['date_period'] == 'W') {
$first_weekday = $end_date - (date('w',$end_date) * 86400);
$start_date = func_prepare_search_date($first_weekday);
}
AFTER it insert:
Code:
elseif ($data["date_period"] == "T"){ # BCSE added to do last 30 days
$start_date = $end_date - (30 * 24 * 60 * 60);
}
5. Add a link into your skin/common_files/single/menu_box.tpl below the line for orders. Example way you can do it.
Find:
Code:
<a href="{$catalogs.admin}/orders.php?date=M">{$lng.lbl_this_month_orders}</a>
After add:
Code:
<a href="{$catalogs.admin}/orders30.php">Orders 30 days</a>
That should do it!
Variation - Only last 30 days of processed orders. (
NOTE if you want to do both the above and this one, ONLY do steps 1-3 and step 5. So do not repeat step 4 again)
1. BACKUP ANY FILES YOU CHANGE.....
2. Make a copy of your admin/orders.php file, rename this copy to orders30p.php
3. Open up orders30p.php and find the line:
Code:
x_session_register("search_data");
AFTER that line insert:
Code:
#BCSE
if(!empty($search_data[orders]))
unset($search_data[orders]);
$search_data[orders][sort_field] = 'orderid';
$search_data[orders][sort_direction] = 1;
$search_data[orders][by_username]='on';
$search_data[orders][by_firstname]='on';
$search_data[orders][by_lastname]='on';
$search_data[orders][date_period]='T';
$mode="search";
$search_data[orders][status]='P';
#BCSE
4. Open up include/orders.php and find this code:
Code:
} elseif ($data['date_period'] == 'W') {
$first_weekday = $end_date - (date('w',$end_date) * 86400);
$start_date = func_prepare_search_date($first_weekday);
}
AFTER it insert:
Code:
elseif ($data["date_period"] == "T"){ # BCSE added to do last 30 days
$start_date = $end_date - (30 * 24 * 60 * 60);
}
5. Add a link into your skin/common_files/single/menu_box.tpl below the line for orders. Example way you can do it.
Find:
Code:
<a href="{$catalogs.admin}/orders.php?date=M">{$lng.lbl_this_month_orders}</a>
After add:
Code:
<a href="{$catalogs.admin}/orders30p.php">Orders 30 days Processed</a>
Hope that helps some out there.
Carrie