Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Orders not showing up in admin(db-ok)


Guest

Recommended Posts

My problem is that I don't see any of my orders in admin, although I se that 4 of them are pending. I also don't see my orders in a customer history. When i type the id of the order manualy it shows. I checked my database, and previous topics on this forum regarding that problem.

1. My table orders is OK

2. My table orders_total is ok

3. My orders_status table olso is OK

4. Each order in db has its status

Db seems ok... But I tried to reinstall admin and without success, the problem is the same. I don't use PayPal. I use Table for waight, and table for zone, also Cash on delivery(COD) contributory. Please help. How to debug it, and find out whats wrong? Its real order, not playing for fun. Thanks.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

I made this change and orders started all showing up. However, they showed up as 4 entries (base price, tax, shipping, total).

 

So, the question is, how can I get all the pending orders to show up, but only show the order total?

 

Thanks,

Arthur McLean

Link to comment
Share on other sites

  • 1 month later...

While in PHPMyAdmin, click the SQL tab and enter the following:

update orders set orders_status=1 where orders_status=0;

and your orders will appear in the listing.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...

I did the "ot.class" thing and now my orders are showing up in admin (orders.php?status=1).

 

However, I am getting this error when I click directly on orders.php:

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1



select count(*) as 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



[TEP STOP]

 

What did I do? :oops:

Jen

Link to comment
Share on other sites

Hi

I have same problem. Orders not showing up in Admin or under Customer. Carried out mod and ot.class = 'ot_total' removal and orders have now started appearing in Admin, but can still not get them to show up when you login as a customer and look at My Account- My Orders. I have also carried out the database refresh as suggested by Jim but still no good.

p.s. I am running MS2 with no contributions added.

Any help would be most appreciated.

thanks

Rich

"May the seam be with you"

Link to comment
Share on other sites

Hi

Sorry about this flood of messages.

Here is the situation. I have carried out all mods as per this thread i.e. ot.class removal in the orders.php.

When you go in with a fresh session into Admin-Orders you DO see total orders. Then if you select say Pending from the drop down you get what you requested, if you then select ALL Orders from the drop down it WONT display any at all. If you log out then back in again with a new session they once again display ok. Is this a bug?

If you log into catalog using My Account- My Orders NOTHING shows.

Anyone any clues on this one.

Once again apologies for flood of emails but an unable to delete or modify previous messages due to board permissions.

thanks

Rich

"May the seam be with you"

Link to comment
Share on other sites

I'm having somewhat of the same problem:

when logging in to catalog :arrow: account no problems...

when logging in to catalog :arrow: admin :arrow: customers :arrow: orders everything shows up (with status- 'all orders')...if I go to appropriate status, orders still show up...

(here's the catch) going back to status- 'all orders' shows nothing...clicking orders in left column resets it and 'all orders' show correctly again...

Which mod in this thread has worked so far? Repost as a bug? Any other suggestions?

Thanks!

Link to comment
Share on other sites

Hi Michael

OK, if I select orders from left-hand panel my orders refresh as well and all shows up.

I still have the problem now when a customer logs in and wishes to see his orders- nothing shows.

thanks

Rich

"May the seam be with you"

Link to comment
Share on other sites

  • 3 weeks later...

Jim,

This sql query...

update orders set orders_status=1 where orders_status=0;
... works to a point.

 

When I log in as a customer and place a new order, it still doesn't update the database. I have to keep running the above query in phpMyAdmin to see new orders.

 

Is there a way that this query can be run automatically so that the database is updated as soon as an order is placed?

 

Thanks!

Link to comment
Share on other sites

Here is the proper solution to fix this bug. The previous proposed solutions do NOT address the true problem (and a simple one at that). Since it's good to learn to troubleshoot things yourself, here's a longwinded explanation. If you just look at the url in your browser, you can figure what the problem is easily. Notice that the orders.php displays all orders fine with the url ending in just "orders.php", subsequent usage of the dropdown to filter results ends as "orders.php?status=#". Notice that when you select all orders, there is no number and it is "orders.php?status=" From there you can deduce that it is not properly detecting the variable "status" as being null and is most likely trying to do a select which depends on the order status being a number 1-3. Upon inspecting the code in orders.php you can see the wrong code statement here:

 

 

   } elseif (isset($HTTP_GET_VARS['status'])) {  

 

The problem is the 'elseif (isset($HTTP_GET_VARS['status']))' statement. The isset function determines if a variable has been set or not. However, $HTTP_GET_VARS is a predefined variable and the result will always end up as true even if the status variable is null as in the "orders.php?status=" case. So the solution is to use the empty function which checks for a non empty and non zero variable. Of course, we want to check if the variable is NOT empty so the earlier block of code needs to be changed to:

 

    } elseif (!empty($HTTP_GET_VARS['status'])) {

 

That's it, and you'll be able to view all the orders correctly.

Link to comment
Share on other sites

  • 4 months later...

i am about to throw oscomerce out the window i am so frustrated i have tried all of these suggestions and still cant get orders too show up. i know i will prol;ly never get answered cause i never do but please someone feel sorry enough for me to help.

Link to comment
Share on other sites

  • 1 month later...

I've not had any luck with the change suggested by kwyjibo, and yrlady is correct in that new orders are only visible when the query in phpMyAdmin is run.

 

Myself and a friend are working on a solution to this, but I'm a designer and he's a programmer with limited experience in web scripts. I've been thinking that maybe a cron job would be one solution, but it's really not very elegant. Is there a way that OSC can sort this out that anyone can think of?

 

For reference, here's the temp solution query again:

 

update orders set orders_status=1 where orders_status=0;
Link to comment
Share on other sites

I've got a solution for you!

 

HURRAH!

 

I'm bit chuffed with myself, I've got it sorted on my system. It wasn't that tricky really.

 

In phpMyAdmin I put through the query, then at the top of the screen there was a link to 'get PHP code', I pressed that copied it into my orders.php code after the requires and bingo bango, Bob's your monkey's uncle, it works!

 

The start of my orders.php page now looks like this:

 

<?php

/*

  $Id: orders.php,v 1.112 2003/06/29 22:50:52 hpdl Exp $

 

  osCommerce, Open Source E-Commerce Solutions

  http://www.oscommerce.com

 

  Copyright © 2003 osCommerce

 

  Released under the GNU General Public License

*/

 

  require('includes/application_top.php');

 

  require(DIR_WS_CLASSES . 'currencies.php');

 

//Mata's attempt to get the SQL database to update on each load of this page

$sql = 'UPDATE orders SET orders_status = 1 WHERE orders_status = 0';

 

  $currencies = new currencies();

 

The only new lines are my comment and the the line starting $sql . It works like a charm and I'm very proud of myself considering I know pretty much nothing about PHP and absolutely nothing about phpMyAdmin!

 

If this doesn't work for people then I'm guessing there is a problem with the setup of your database itself. Good luck!

 

$sql = 'UPDATE orders SET orders_status = 1 WHERE orders_status = 0';

Link to comment
Share on other sites

have you checked the order_status table, to see if there is anything in there? if it has processed, updated, shipped, etc? sometimes that database gets emptied and then you will not see any orders at all in the admin section, no matter how hard you look at the screen.

Link to comment
Share on other sites

  • 4 weeks later...

Ok...here's the scenario...

 

I tried that ot.class thing and the orders show up...but not correctly, like in delivered orders...each order gets separated into 3 different rows, shipping charge, sub-total, and total. And in the pending and processing categories, the order totals don't show up in their rows...

 

I did the thing that kwyjibo recommended to do, and that did fix the show "All Orders" drop down box problem. The MySQL query affects 0 rows....so it does absolutely nothing.

 

What does removing ot.class bypass? What's the true problem? :unsure:

Link to comment
Share on other sites

Okay...I found something suspicious out, in phpMyAdmin,

Under the configuration table,

the configuration_value for MODULE_ORDER_TOTAL_INSTALLED is totally blank. The configuration_value for MODULE_PAYMENT_INSTALLED isn't blank, it's cc.php;moneyorder.php;paypal.php;wu.php.

 

The configuration_value for MODULE_SHIPPING_INSTALLED is also blank :unsure:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...