Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Quick Link to past 30 days orders
 
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features
 
Thread Tools Search this Thread
  #1  
Old 02-04-2009, 11:55 AM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Man
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 2,878
 

Default Quick Link to past 30 days orders

So we switched to 4.1.11 of X-cart back in early December. It was such a PITA to look at the past 30 days orders. So I made a quick link to the past 30 days orders. This should work for later versions of 4.1.x We have it working in 4.1.11

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 = mktime(0,0,0,date("n",$first_weekday),date("j",$first_weekday),date("Y",$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 skin1/admin/menu.tpl below the line for orders. Example way you can do it.
Find:
Code:
<a href="{$catalogs.admin}/orders.php" class="VertMenuItems">{$lng.lbl_orders}</a><br />
After add:
Code:
<a href="{$catalogs.admin}/orders30.php" class="VertMenuItems">{$lng.lbl_orders} 30 Days</a><br />

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 = mktime(0,0,0,date("n",$first_weekday),date("j",$first_weekday),date("Y",$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 skin1/admin/menu.tpl below the line for orders. Example way you can do it.
Find:
Code:
<a href="{$catalogs.admin}/orders.php" class="VertMenuItems">{$lng.lbl_orders}</a><br />
After add:
Code:
<a href="{$catalogs.admin}/orders30p.php" class="VertMenuItems">{$lng.lbl_orders} 30 Days Processed</a><br />

Hope that helps some out there.

Carrie
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote
  #2  
Old 02-09-2009, 08:50 PM
 
chikira chikira is offline
 

Advanced Member
  
Join Date: Jul 2003
Posts: 42
 

Default Re: Quick Link to past 30 days orders

Nice, Just implemented this without any issues.

Thanks Carrie
__________________
Insert into Round_Hole where object=\"Square_Peg\" order by Brute_Force
Reply With Quote
  #3  
Old 04-15-2011, 08:07 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default Re: Quick Link to past 30 days orders

Is there an update on this for newer versions? Thanks
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
  #4  
Old 04-15-2011, 10:21 AM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Man
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 2,878
 

Default Re: Quick Link to past 30 days orders

Quote:
Originally Posted by JWait
Is there an update on this for newer versions? Thanks

Which version would you like? I might be inclined to program again and see if I can get it to work. I don't do much programming anymore since I am managing the business.

Thanks,

Carrie
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote
  #5  
Old 04-15-2011, 12:37 PM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default Re: Quick Link to past 30 days orders

The latest version would make the most sense to me. I don't know about the 4.3 or 4.4 versions, but we have it working on 4.2.3 as it is now.... I just haven't had the time to check it out 4.4.2 other than to find that it loads "All" orders, not just the last 30 days.
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
  #6  
Old 04-15-2011, 12:56 PM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Man
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 2,878
 

Default Re: Quick Link to past 30 days orders

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
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote

The following user thanks BCSE for this useful post:
JWait (04-26-2011)
  #7  
Old 11-02-2016, 01:19 PM
  Vacman's Avatar 
Vacman Vacman is offline
 

X-Adept
  
Join Date: Sep 2005
Location: Torrance, CA
Posts: 792
 

Default Re: Quick Link to past 30 days orders

How about a Yesterday's Orders version? I played around with the line:

$start_date = $end_date - (30 * 24 * 60 * 60);

by changing it to 1 instead of 30, but it doesn't play nice...
__________________
Carl Tice

X-Cart 4.6.6
X-Payments 3.0
ReBOOT 3.4.1

PHP 5.6.30
MySQL 5.6.35
Linux 2.6.32-042stab120.18
ionCube PHP Loader v4.7.3
Perl 5.10.1
Reply With Quote
  #8  
Old 11-04-2016, 11:40 AM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Man
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 2,878
 

Default Re: Quick Link to past 30 days orders

Hi Carl,

Digging up a REALLY old thread huh?

Change the 1 to a 2 and it should work.

thanks

Carrie
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote
  #9  
Old 11-07-2016, 03:17 PM
  Vacman's Avatar 
Vacman Vacman is offline
 

X-Adept
  
Join Date: Sep 2005
Location: Torrance, CA
Posts: 792
 

Default Re: Quick Link to past 30 days orders

Yeah, that "kind of" works. As long as you are not within 3 or 4 hours of the end or beginning of the day.
__________________
Carl Tice

X-Cart 4.6.6
X-Payments 3.0
ReBOOT 3.4.1

PHP 5.6.30
MySQL 5.6.35
Linux 2.6.32-042stab120.18
ionCube PHP Loader v4.7.3
Perl 5.10.1
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:13 AM.

   

 
X-Cart forums © 2001-2018