X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   multiple order status search in order management (https://forum.x-cart.com/showthread.php?t=14911)

danbuhler 06-30-2005 01:35 PM

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

nfc5382 06-17-2006 05:39 AM

this is great, works perfect in 4.0.18

2coolbaby 07-19-2006 12:04 PM

Make sure you have a back-up before trying this. I just got a blank page after making these changes.

klinetim 05-15-2013 06:18 AM

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!

nfc5382 09-07-2016 05:49 PM

Re: multiple order status search in order management
 
Still works in 4.7.6!

mcinque 11-10-2017 08:12 AM

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?

pauldodman 11-10-2017 08:22 AM

Re: multiple order status search in order management
 
Do you see any changes?
Have you refreshed cache?

mcinque 11-10-2017 08:39 AM

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?

pauldodman 11-10-2017 09:13 AM

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">

mcinque 11-13-2017 04:55 AM

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?


All times are GMT -8. The time now is 12:25 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.