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

Change all Processed Orders to Complete
 
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features
 
Thread Tools Search this Thread
  #1  
Old 09-24-2013, 03:08 AM
 
chrischall chrischall is offline
 

Advanced Member
  
Join Date: Jul 2005
Posts: 36
 

Default Change all Processed Orders to Complete

Hi all,

We were finding it quite laborious individually changing the dropdown status of a page full of orders from processed to complete so got xcart to write some javascript to change them all with one click of a button. It was written for a 4.1 store but just successfully installed on a 4.5.5 version so guessing it would work on most shops.

1) Create a file called change_all_statuses.tpl in skin/common_files/ and put this in it:

Code:
{* Parameters: statuses - array of tag names statuses_form - form name with these statuses *} <SCRIPT> function change_stat_all() {ldelim} var x, y; var formname, arr, options; formname = statuses_form; arr = statuses; if(!document.forms[formname] || arr.length == 0) return false; for(x = 0; x < arr.length; x++) if(document.forms[formname].elements[arr[x]] && document.forms[formname].elements[arr[x]].options[document.forms[formname].elements[arr[x]].selectedIndex].value == 'P') {ldelim} options = document.forms[formname].elements[arr[x]].options; for(y = 0; y < options.length; y++) if(options[y].value == 'C') document.forms[formname].elements[arr[x]].options[y].selected = true; {rdelim} {rdelim} </SCRIPT>


2) Open skin/common_files/main/orders_list.tpl

Code:
AFTER var txt_delete_selected_orders_warning = "{$lng.txt_delete_selected_orders_warning|wm_remove|escape:javascript|strip_tags}"; INSERT var statuses = new Array({foreach from=$orders item=v key=k}{if $k > 0},{/if}'order_status[{$v.orderid}]'{/foreach}); var old_statuses = new Array({foreach from=$orders item=v key=k}{if $k > 0},{/if}'order_status_old[{$v.orderid}]'{/foreach}); var statuses_form = 'processorderform'; AFTER {include file="main/check_all_row.tpl" form="processorderform" prefix="orderids"} INSERT {include file="change_all_statuses.tpl"} <div><a href="javascript:change_stat_all();">Change All Processed to Complete</a></div>

3) do a template cleanup


Hope somebody finds this useful!
__________________
X-Cart version 4.6.3
Reply With Quote

The following 3 users thank chrischall for this useful post:
ADDISON (01-14-2014), DanUK (10-22-2014), Kman (10-10-2013)
  #2  
Old 01-13-2014, 10:20 PM
 
CBONE CBONE is offline
 

Newbie
  
Join Date: Dec 2011
Posts: 3
 

Default Re: Change all Processed Orders to Complete

Interesting, how exactly does it work? do you have to change all orders? or just the ones you select?
__________________
VV
Reply With Quote
  #3  
Old 01-14-2014, 04:22 AM
 
chrischall chrischall is offline
 

Advanced Member
  
Join Date: Jul 2005
Posts: 36
 

Default Re: Change all Processed Orders to Complete

Basically it changes all orders listed on the orders search page from processed to complete - just uses javascript to change the value in the form dropdown.

If you only want to change some orders then do a specific orders search beforehand
__________________
X-Cart version 4.6.3
Reply With Quote
  #4  
Old 01-15-2014, 04:30 AM
 
xtech xtech is offline
 

X-Adept
  
Join Date: Jun 2010
Posts: 605
 

Default Re: Change all Processed Orders to Complete

Hello,
can I able to see a demo? Will it work on 4.6.1 Platinum?

If I want to add tracking no from process to complete in bulk then will it work?

Thanks.
__________________
X-cart Platinum
4.6.1
Reboot template
Reply With Quote
  #5  
Old 10-22-2014, 12:54 AM
 
DanUK DanUK is offline
 

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

Default Re: Change all Processed Orders to Complete

Works on 4.6.1, many thanks!
__________________
4.4.2

and

4.6.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 02:49 AM.

   

 
X-Cart forums © 2001-2020