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

multiple order status search in order management

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 06-30-2005, 01:35 PM
 
danbuhler danbuhler is offline
 

Member
  
Join Date: Mar 2005
Location: Fraser Valley, BC
Posts: 24
 

Default multiple order status search in order management

xcart 4.0.13

include/orders.php
Code:
# Search by order status if (!empty($data["status"]) && $data["status"] != array(""=>"1")) if (is_array($data["status"])) { $sql_status = ""; foreach ($data["status"] as $k=>$v) $sql_status .= " OR $sql_tbl[orders].status='".$k."'"; $search_condition .= " AND (".substr($sql_status,4).")"; } else { $search_condition .= " AND $sql_tbl[orders].status='".$data["status"]."'"; }

the $data["status"] != array(""=>"1")) is so that the blank option can be selected to return any order status

skin1/main/order_status.tpl
Code:
<OPTION value="I" {if $status eq "I" || $status.I eq 1}selected{/if}>{$lng.lbl_not_finished}</OPTION> <OPTION value="Q" {if $status eq "Q" || $status.Q eq 1}selected{/if}>{$lng.lbl_queued}</OPTION> <OPTION value="P" {if $status eq "P" || $status.P eq 1}selected{/if}>{$lng.lbl_processed}</OPTION> <OPTION value="B" {if $status eq "B" || $status.B eq 1}selected{/if}>{$lng.lbl_backordered}</OPTION> <OPTION value="D" {if $status eq "D" || $status.D eq 1}selected{/if}>{$lng.lbl_declined}</OPTION> <OPTION value="F" {if $status eq "F" || $status.F eq 1}selected{/if}>{$lng.lbl_failed}</OPTION> <OPTION value="C" {if $status eq "C" || $status.C eq 1}selected{/if}>{$lng.lbl_complete}</OPTION>

adding the || $status entries ensures backwards compatibility with other scripts that use order_status.tpl

skin1/main/orders.tpl
Code:
<TD class="FormButton" nowrap>{$lng.lbl_order_status}:</TD> <TD width="10"></TD> <TD>{include file="main/order_status.tpl" status=$search_prefilled.status mode="select" name="posted_data[status][]" extended="Y" ex tra="style='width:70%' multiple size=8"}</TD>

name="posted_data[status][]" has an extra [] at the end to turn it into an array
the html code to make it a multiple select is passed with the extra parameter

On my order screen I have also moved the status selection box out of advanced order options up to the top to make it more accessible.

suggestions welcome, for i am not a great php coder by any means
__________________
X-Cart 4.0.13 Gold
Reply With Quote
  #2  
Old 06-17-2006, 05:39 AM
 
nfc5382 nfc5382 is offline
 

X-Adept
  
Join Date: Nov 2002
Posts: 477
 

Default

this is great, works perfect in 4.0.18
__________________
-----------------------
x-cart v4.7.6 [LIVE]
x-cart v4.0.18 [retired 2004-2016]
x-cart v3.5.13 [retired]
x-cart v3.4.14 [retired]
Reply With Quote

The following user thanks nfc5382 for this useful post:
thesporeworks (08-13-2009)
  #3  
Old 07-19-2006, 12:04 PM
  2coolbaby's Avatar 
2coolbaby 2coolbaby is offline
 

eXpert
  
Join Date: Sep 2004
Location: TN moving to FL
Posts: 265
 

Default

Make sure you have a back-up before trying this. I just got a blank page after making these changes.
__________________
Mary Lee
-------------------
Dinner and a Murder Mystery Games
http://www.dinnerandamurder.com

x-cart version 4.7.5 / Mac OS 10.10.5 and Windows 8/10 sometimes - Ideal Responsive Template
Reply With Quote
  #4  
Old 05-15-2013, 06:18 AM
 
klinetim klinetim is offline
 

Advanced Member
  
Join Date: Oct 2011
Posts: 58
 

Default Re: multiple order status search in order management

Hello,

I know this is an old thread - but it worked perfectly for me using 4.4.5.

The only major changes were that the order_status.tpl and orders.tpl are in skin/common_files/main/. Moving the order status selection box up out of the advanced options was a good idea too. Thanks!
__________________
Tim @ K-Line
X-Cart Version 4.4.5
http://klineind.com
Reply With Quote
  #5  
Old 09-07-2016, 05:49 PM
 
nfc5382 nfc5382 is offline
 

X-Adept
  
Join Date: Nov 2002
Posts: 477
 

Default Re: multiple order status search in order management

Still works in 4.7.6!
__________________
-----------------------
x-cart v4.7.6 [LIVE]
x-cart v4.0.18 [retired 2004-2016]
x-cart v3.5.13 [retired]
x-cart v3.4.14 [retired]
Reply With Quote

The following user thanks nfc5382 for this useful post:
qualiteam (09-13-2016)
  #6  
Old 11-10-2017, 08:12 AM
 
mcinque mcinque is offline
 

Advanced Member
  
Join Date: Sep 2006
Posts: 96
 

Default Re: multiple order status search in order management

Seems a very basic and simple mod to apply, but it doesn't work for me in 4.6.4.
I should see a multiple select in orders search, right?
Reply With Quote
  #7  
Old 11-10-2017, 08:22 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,052
 

Default Re: multiple order status search in order management

Do you see any changes?
Have you refreshed cache?
__________________
Paul Dodman
e-business & m-commerce consultant
w: www.luminointernet.com
e: xcart@luminointernet.com

Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart.
Reply With Quote
  #8  
Old 11-10-2017, 08:39 AM
 
mcinque mcinque is offline
 

Advanced Member
  
Join Date: Sep 2006
Posts: 96
 

Default Re: multiple order status search in order management

Thank you pauldodman for you reply.

I cleaned up cache and tpl after file modification and upload with cleanup.php, I don't see a single difference in admin>order search>advanced order search.

I should expect to have the order status field changed from drop down to multiple select (like order features), right?
Reply With Quote
  #9  
Old 11-10-2017, 09:13 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,052
 

Default Re: multiple order status search in order management

I'm not sure.

In order_status.tpl

Try changing:

<select name="{$name}" {$extra}>

to:
<select name="{$name}" {$extra} multiple="multiple" size="9">
__________________
Paul Dodman
e-business & m-commerce consultant
w: www.luminointernet.com
e: xcart@luminointernet.com

Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart.
Reply With Quote
  #10  
Old 11-13-2017, 04:55 AM
 
mcinque mcinque is offline
 

Advanced Member
  
Join Date: Sep 2006
Posts: 96
 

Default Re: multiple order status search in order management

With the correction you suggesterd it works, thanks.
But in admin now every order listed has a multple select, while should be in that way only in search, not in order list. Do you have any kind suggestion also for this?
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 02:05 PM.

   

 
X-Cart forums © 2001-2020