Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

orders not showing in admin!


Guest

Recommended Posts

i don't know what happened to my shop but here are the symptoms :)

customer buys a product...i get the order, he gets it too, the order is displayed in his account, order exists in the database...but on admin-orders..i can't see it..only when i enter the order number i can see it...also orders are jumping numbers kind of...instead of order 239...it goes 240, 242, etc...any ideas?

thanks

Link to comment
Share on other sites

i don't know what happened to my shop but here are the symptoms :)

customer buys a product...i get the order, he gets it too, the order is displayed in his account, order exists in the database...but on admin-orders..i can't see it..only when i enter the order number i can see it...also orders are jumping numbers kind of...instead of order 239...it goes 240, 242, etc...any ideas?

Strange error but (assuming you can see MySQL errors, either in a log file or echo'ed to the screen) why don't you make a deliberate error (rename a column name slightly e.g.) in the query that builds that table. Admin/order.php around line 361:

	  $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC";
}
$orders_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS,

Then perhaps you can deduct why that query doesn't yield any results (language issue perhaps?).

Link to comment
Share on other sites

i run the english language..but i have installed several mods..like order creator, editor, ip recorder...will try and see

if i create the orders they do display in the admin side though

Link to comment
Share on other sites

ok did this

 

$orders_query_raw = "select o.orders_id, o.customers_name2

 

added the 2 number and got this

 

1054 - Unknown column 'o.customers_name2' in 'field list'

 

select o.orders_id, o.customers_name2, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where o.orders_status = s.orders_status_id and s.language_id = '1' and ot.class = 'ot_total' order by o.orders_id DESC limit 0, 20

Link to comment
Share on other sites

ok did this

 

$orders_query_raw = "select o.orders_id, o.customers_name2

 

added the 2 number and got this

 

1054 - Unknown column 'o.customers_name2' in 'field list'

 

select o.orders_id, o.customers_name2, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where o.orders_status = s.orders_status_id and s.language_id = '1' and ot.class = 'ot_total' order by o.orders_id DESC limit 0, 20

Now copy and paste that in a text file, correct the error and copy and paste it in phpAdmin to see how many results that gives (should be 20). Do you use language_id 1? Otherwise play with that (make it 2, 3, 4) if you don't get any results from the query.

Link to comment
Share on other sites

Now copy and paste that in a text file, correct the error and copy and paste it in phpAdmin to see how many results that gives (should be 20). Do you use language_id 1? Otherwise play with that (make it 2, 3, 4) if you don't get any results from the query.

are you sure that nothing will affect my database if i run that query?...i have hundreds of products

i use the default english language :rolleyes:

Link to comment
Share on other sites

are you sure that nothing will affect my database if i run that query?...i have hundreds of products

i use the default english language :rolleyes:

Absolutely. But if you want to be safe: make a backup first :)

Link to comment
Share on other sites

ok did that...what is strange is that i see the orders that i see in admin..the wrong ones..not all of them

it goes like 118, 119 and then 193

Showing rows 0 - 19 (20 total, Query took 0.0018 sec) [orders_id: 232 - 100]

what's next?..where do i change the language id? in the orders.php file or in the database?

thanks a lot Jan for your help

Link to comment
Share on other sites

ok did that...what is strange is that i see the orders that i see in admin..the wrong ones..not all of them

it goes like 118, 119 and then 193

Showing rows 0 - 19 (20 total, Query took 0.0018 sec) [orders_id: 232 - 100]

what's next?..where do i change the language id? in the orders.php file or in the database?

Changing the language_id doesn't make much sense now. That query comes back with results so at least those should be shown in the admin. The class split_page_results actually changes the query (adds the limit x, y). Perhaps check what happens by adding one line that now should show above the list and below the heading "Orders" the same query (few lines further from where you changed the query):

	$orders_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $orders_query_raw, $orders_query_numrows);
$orders_query = tep_db_query($orders_query_raw);
echo $orders_query_raw; // check the query again
while ($orders = tep_db_fetch_array($orders_query)) {

Link to comment
Share on other sites

i added that line as you said

now in admin-orders i get this

 

select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where o.orders_status = s.orders_status_id and s.language_id = '1' and ot.class = 'ot_total' order by o.orders_id DESC limit 0, 20

 

above the orders tables with customers..etc i use rc.2.2..if that helps

Link to comment
Share on other sites

i added that line as you said

now in admin-orders i get this

 

select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where o.orders_status = s.orders_status_id and s.language_id = '1' and ot.class = 'ot_total' order by o.orders_id DESC limit 0, 20

 

above the orders tables with customers..etc i use rc.2.2..if that helps

So far, so good. That query gives results as you have tested in phpMyAdmin so why don't the results show up next?

Try adding three lines a little bit further. That should at least show one result:

	while ($orders = tep_db_fetch_array($orders_query)) {
echo '<pre>'; // new
print_r($orders); // new
echo '</pre>'; // new

Link to comment
Share on other sites

this is what i get below the first query

 

Array

(

[orders_id] => 232

[customers_name] => name

[payment_method] => Paypal

[date_purchased] => 2009-01-24 07:16:54

[last_modified] => 2009-01-25 06:56:44

[currency] => USD

[currency_value] => 1.000000

[orders_status_name] => pending

[order_total] => $30.00

)

 

Array

(

[orders_id] => 183

[customers_name] => name

[payment_method] => Payment on Local Pickup. We acce

[date_purchased] => 2008-12-14 15:41:09

[last_modified] => 2008-12-14 15:48:10

[currency] => USD

[currency_value] => 1.000000

[orders_status_name] =>pending

[order_total] => $12.00

)

 

 

i replaced the names here...but these are the same orders that i see in admin-orders...not the ones processed

Link to comment
Share on other sites

but these are the same orders that i see in admin-orders...not the ones processed

I'm not sure I follow you here. I understood you didn't see any orders, now you are saying you don't seen the processed ones?

 

If so, better check your table orders_status to see if you have orders_status_id 1, 2, and 3 for language_id 1 and that your table orders also contains those numbers for orders_status. If you only have 1 and 2 in orders_status but in table orders also orders with orders_status 3, those would never show up with that query.

Link to comment
Share on other sites

sorry for the confusion...what i mean is that these orders are the ones i've written in admin..i have the create order module..but not the ones that are normally processed and i don't see them without entering the order id. as you can see i can't see the orders between 183 and 232..anyway thanks a lot for your help and patience here

Link to comment
Share on other sites

what i mean is that these orders are the ones i've written in admin..i have the create order module..but not the ones that are normally processed and i don't see them without entering the order id. as you can see i can't see the orders between 183 and 232..

Yes, that changes the story. You could try changing the query to not use the table orders_status (as below, left in the old query but commented out). That should output "unknown" for each status but show all orders:

	} else {
//	  $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC";
  $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, 'unknown' as orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id) where ot.class = 'ot_total' order by o.orders_id DESC";
}
$orders_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $orders_query_raw, $orders_query_numrows);

Link to comment
Share on other sites

it does appear unknown on the status column for the orders...but still can't see the new ones :(...i think that maybe one of the shop modules is doing something bad..i have around 40 modules installed

i might try to do one thing..if the orders.php file is the fault...i can replace the original oscommerce one and then make the edits for the modules that i have installed.

but if it's still the same thing that means that other file is wrong right?..maybe the one that processes the orders

Link to comment
Share on other sites

it does appear unknown on the status column for the orders...but still can't see the new ones

Sounds weird but I don't know what these other contributions did.

i might try to do one thing..if the orders.php file is the fault...i can replace the original oscommerce one and then make the edits for the modules that i have installed.

but if it's still the same thing that means that other file is wrong right?..maybe the one that processes the orders

Not a clue. With a standard osC this query should show all orders but I'm not familiar with the contributions you seem to be using. Might be an issue with those. I just don't know.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...