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

Admin Change All Status

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 03-30-2005, 06:18 AM
 
sstillwell@aerostich.com sstillwell@aerostich.com is offline
 

eXpert
  
Join Date: Jun 2004
Location: Duluth, MN
Posts: 242
 

Default Admin Change All Status

This is a really simple mod.

My order processors really like the "Check All" link when dealing with orders. I wanted to create a similar link that does the same thing for the order status drop down box. I wanted a link to set them all to Processed, then another to set them all to Complete.

Here goes.

1. In skin1/main/orders_list.tpl

Add:
Code:
orderstatus = new Array({foreach from=$orders item=v key=k}{if $k > 0},{/if}'order_status[{$v.orderid}]'{/foreach});
After:
Code:
<SCRIPT type="text/javascript" language="JavaScript 1.2"> <!-- checkboxes_form = 'processorderform'; checkboxes = new Array({foreach from=$orders item=v key=k}{if $k > 0},{/if}'orderids[{$v.orderid}]'{/foreach});

To look like:
Code:
<SCRIPT type="text/javascript" language="JavaScript 1.2"> <!-- checkboxes_form = 'processorderform'; checkboxes = new Array({foreach from=$orders item=v key=k}{if $k > 0},{/if}'orderids[{$v.orderid}]'{/foreach}); orderstatus = new Array({foreach from=$orders item=v key=k}{if $k > 0},{/if}'order_status[{$v.orderid}]'{/foreach}); --> </SCRIPT>

AND

Add:
Code:
<DIV style="line-height:170%">Change all to Processed / Change all to Complete</DIV>

After:
Code:
<DIV style="line-height:170%">{$lng.lbl_check_all} / {$lng.lbl_uncheck_all}</DIV>

To look like:
Code:
{include file="change_all_checkboxes.tpl"} <DIV style="line-height:170%">{$lng.lbl_check_all} / {$lng.lbl_uncheck_all}</DIV> <DIV style="line-height:170%">Change all to Processed / Change all to Complete</DIV> <TABLE border="0" cellpadding="2" cellspacing="1" width="100%"> <FORM action="process_order.php" method="POST" name="processorderform">

2. In skin1/change_all_checkboxes.tpl

Add:
Code:
function change_all_status(flag, formname, arr) {ldelim} var x; if(!formname) formname = checkboxes_form; if(!arr) arr = orderstatus; if(!document.forms[formname] || arr.length == 0) return false; for(x = 0; x < arr.length; x++) if(arr[x] != '' && document.forms[formname].elements[arr[x]]) document.forms[formname].elements[arr[x]].selectedIndex = flag; {rdelim}

After:
Code:
function change_all(flag, formname, arr) {ldelim} var x; if(!formname) formname = checkboxes_form; if(!arr) arr = checkboxes; if(!document.forms[formname] || arr.length == 0) return false; for(x = 0; x < arr.length; x++) if(arr[x] != '' && document.forms[formname].elements[arr[x]]) document.forms[formname].elements[arr[x]].checked = flag; {rdelim}

To look like:
Code:
<SCRIPT> function change_all(flag, formname, arr) {ldelim} var x; if(!formname) formname = checkboxes_form; if(!arr) arr = checkboxes; if(!document.forms[formname] || arr.length == 0) return false; for(x = 0; x < arr.length; x++) if(arr[x] != '' && document.forms[formname].elements[arr[x]]) document.forms[formname].elements[arr[x]].checked = flag; {rdelim} function change_all_status(flag, formname, arr) {ldelim} var x; if(!formname) formname = checkboxes_form; if(!arr) arr = orderstatus; if(!document.forms[formname] || arr.length == 0) return false; for(x = 0; x < arr.length; x++) if(arr[x] != '' && document.forms[formname].elements[arr[x]]) document.forms[formname].elements[arr[x]].selectedIndex = flag; {rdelim} </SCRIPT>
__________________
No longer using Xcart, was good while it lasted.
Reply With Quote
  #2  
Old 10-05-2005, 03:52 AM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 800
 

Default

Thanks for this, just tested it out and it works great!

Thanks again,

Dan
__________________
4.4.2

and

4.6.1
Reply With Quote
  #3  
Old 10-05-2005, 04:52 AM
 
weckie weckie is offline
 

eXpert
  
Join Date: Feb 2005
Location: Netherlands
Posts: 220
 

Default

Hmm nice done, BUT: Very dangerous when you use it. Take care.

We got per day about 25 orders, and each order has different status, because the status depends on several things. f.i. payment moment/receiving.

Just a little note......
__________________
Herman Steijn

Using: X-cart 4.5.4
AT: http://www.weckonline.com LIVE
Reply With Quote
  #4  
Old 10-05-2005, 04:55 AM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 800
 

Default

It would be handy if it would update all CHECKED rather than all at once, that might help. Not sure how this is done yet.

Dan
__________________
4.4.2

and

4.6.1
Reply With Quote
  #5  
Old 10-05-2005, 06:28 AM
 
sstillwell@aerostich.com sstillwell@aerostich.com is offline
 

eXpert
  
Join Date: Jun 2004
Location: Duluth, MN
Posts: 242
 

Default

Weckie,
We get about 150 orders a day and have not had a problem, but then again we just use the front end for order taking. The orders are then set at complete and entered into our back office order processing software.

Dan,
Yeah, I agree, but it was a simple javascript hack that works great.
__________________
No longer using Xcart, was good while it lasted.
Reply With Quote
  #6  
Old 10-05-2005, 06:53 AM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 800
 

Default

Actually, it's not a problem for us as we're filtering by Queued anyway.

Thanks again

Dan
__________________
4.4.2

and

4.6.1
Reply With Quote
  #7  
Old 10-11-2005, 05:16 AM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 800
 

Default

Just a quick update, I surrounded the code that displays the links with an if statement to stop it showing when the customer looks at the Order History, so:



Code:
<DIV style="line-height:170%">Change all to Processed / Change all to Complete</DIV>

changes to:

Code:
{if $usertype ne "C"} <DIV style="line-height:170%">Change all to Processed / Change all to Complete</DIV> {/if}

Dan
__________________
4.4.2

and

4.6.1
Reply With Quote
  #8  
Old 03-15-2006, 12:55 PM
 
jdedba jdedba is offline
 

Advanced Member
  
Join Date: Dec 2004
Posts: 96
 

Default

Thank you for the mod.
__________________
version 4.1.1
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


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 03:57 PM.

   

 
X-Cart forums © 2001-2020