4.3.6 Admin Panel - Orders Search By Order Id

Seems more logical to be able to quick search by Order ID than Issuer so I changed the section of code in

\design\backend\templates\views\orders\components\orders_search_form.tpl

to:

{__("order_id")}
so now Order ID shows up in the quick search side panel instead of issuer, but it does not work. There is an array somewhere that has issuer instead of order_id. Anyone know off the top of there head where so I can change it?

I would look in the php controller since the template is just a front-end for that. Need to be sure that order_id isa supported _REQUEST.

app/schemas/search/schema.php

try to replace

'action_link' => 'orders.manage?order_id=%search_num%&compact=Y&email=%search%&cname=%search%&content_id=order_content',

with

'action_link' => 'orders.manage?order_id=%search%&compact=Y&email=%search%&cname=%search%&content_id=order_content',

Then clear cache and check the result

(!) No tested

Negative when tested.

So the problem seems to be in how it is structuring the URL when you hit search. When I made the change to

\design\backend\templates\views\orders\components\orders_search_form.tpl

It used the same spot in the URL for Order_ID which is the incorrect spot in the array. The data is being put where it is blue below, not where it is red, where I need it to be.

https://www.dark-storm.com/admin.php?is_search=Y&cname=&email=&order_id=36500&total_from=&total_to=&dispatch%5Borders.manage%5D=Search&period=A&time_from=&time_to=&tax_exempt=&order_id=XXXXX&credit_memo_id=&invoice_id=&p_ids=&gift_cert_code=&gift_cert_in=B%7CU&hint_new_view=Name

Hmm... My changes works on the local installation

http://prntscr.com/ckixf1

Different search box. Here is where we are trying to enter the order # and his search.

OK. You asked about quick search. It confused me. Now you need to delete the Order ID field from the advanced search form. It should solve the problem.

OK. You asked about quick search. It confused me. Now you need to delete the Order ID field from the advanced search form. It should solve the problem.

That was simple. Worked. Thank you!!!

You are welcome!

Hi

I am also very interested in having a search by Order ID to pull up orders.

I tried following the steps above by altering

\design\backend\templates\views\orders\components\orders_search_form.tpl

app/schemas/search/schema.php

then cleared cache but didnt see the Order ID field in the search side panel.

Im on 4.6.3 and not 4.3.6 and i also

tried to switch the phone field for the Order_id field. Ed Newman wrote that he swicthed it with "issuer" which i dont see as a field.

was that field in 4.3.6

Also dont know what is meant by

"Now you need to delete the Order ID field from the advanced search form. It should solve the problem."

as dont see how to go about deleting that field. Isit in some file?

Any help would be greaty appreciated as moving from 2.2 to 4.6 has been great except for a few issues such as this.

As ive been doing a search for orders on quick search but takes abit of time as it also searches products.

I have over 600,000 products so every time i search for order numbers it also pulls up products which is very

inefficient and time consuming

Thanks in advance.

Is your question about quick search or orders search form?

You do not need to do any modifications. Searching by Order ID works perfectly when you search from the "Quick Menu" search field.

Hi

Was talking about having it look exactly like message #6 on the orders search form.

I have been doing the search from the quick search on top right page of admin but its a bit slow. as that searches both orders and products.

If i put in order #125 say it will give me 2 results . One for orders and another for products. Then i have to click on orders to see

what i wanted. when you have 1/2 million products there is a bit of delay in getting that order # to show as it also gives you results for

products also. Not a big deal but when you have a few orders to pull up to print labels at the end of the day it does take a little time.

I can pull up orders from the orders search form but i have to click advanced and then enter the order #. Which is also time consuming.

The way message #6 would work perfectly for me.

That makes sense. Try getting rid of "#". That seems to pull up more results than just searching "125". Seems the search field also searches for any match instead of all or exact phrase. Perhaps there is an easier mod to get what you need. You can try modding the search type to exact match or perhaps mod the quick search so it only searches orders. Modding is not my strong point though so I have no other suggestions. Good Luck.

I've found the easiest way to do this (and it has pretty small impact on performance) is to intercept the "Quick search" (dispatch=search.results) and check if the value is_numeric() and if so, then see if it's an order_id. If so, display the orders.details page.

If not, check if it's a product_code and if there's a match, display the products.details page.

Otherwise fall through to the normal quick search/search results page.

You can then search for a product or order from any admin page quickly and easily.

To implement, create an search.pre.php in your backend my_changes controllers.

Check whether REQUESTS 'dispatch=search.results' (or $mode == 'results') and 'q' are set and valid

Perform the queries

If hit, redirect appropriately

if not fall through and return from the search.pre.php controller so the normal search activity is performed

Hi

Was talking about having it look exactly like message #6 on the orders search form.

I have been doing the search from the quick search on top right page of admin but its a bit slow. as that searches both orders and products.

If i put in order #125 say it will give me 2 results . One for orders and another for products. Then i have to click on orders to see

what i wanted. when you have 1/2 million products there is a bit of delay in getting that order # to show as it also gives you results for

products also. Not a big deal but when you have a few orders to pull up to print labels at the end of the day it does take a little time.

I can pull up orders from the orders search form but i have to click advanced and then enter the order #. Which is also time consuming.

The way message #6 would work perfectly for me.

In this case all you need is to open the following file

design/backend/templates/views/orders/components/orders_search_form.tpl

and move the following code

{__("order_id")}

under the following line

{$extra nofilter}

Moved the text under {$extra nofilter} as you wrote in

design/backend/templates/views/orders/components/orders_search_form.tpl

and cleared the cache but didnt see a diffierence.

This was after i made the changes after altering the two files below as suggested in beginning of post

design/backend/templates/views/orders/components/orders_search_form.tpl

app/schemas/search/schema.php

when that didnt work i tried to cut and paste the code under the original files and that also didnt work.

Both times I also cleared the cache.

Im also on 4.6.3 if it makes a difference.

Either way tired it the Order ID search box didnt show.

did i miss something.

Thanks again in advance.

Try do delete the var/cache directory manually

I see a

cache

cache1

cache2

In there.

Do i delele all 3 directories and is it ok to delete the directory as i see alot of other sudirectories and files in them.

I assume if its ok then they will regenerate again.

I see a

cache

cache1

cache2

In there.

Do i delele all 3 directories and is it ok to delete the directory as i see alot of other sudirectories and files in them.

I assume if its ok then they will regenerate again.

Yes, you can delete 3 directories. It will not cause any problems