Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Moved to another server and now orders do not show up!


xao

Recommended Posts

Ok, I have been debugging this for two and half days. On the plus side, I'm learning a lot about PHP and MySQL...

 

Anyways, the problem is, I can walk through the order process, and it appears to go through and the customer receives an e-mail receipt, however, it does not show up in the Admin section.

 

The odd thing about the E-mail invoice sent, it has an Order id of '0'..... Another odd thing about the e-mail receipt is that it does not show the sub-total, tax, or total. It shows all the items, but not the calculations.

 

Now looking into the database, I see the following:

Under the 'orders' table it does have the order with the correct 'orders_id' associated with it and it increments with each order. It does NOT however, have the credit card (encrypted of course) in the table.

 

Now under the 'orders_total' table they have the correct 'orders_id' up until the migration, then every test order I have done since then is '0'. So I'm assuming there is a problem somewhere during the checkout_process or checkout_success in that it has a correct 'orders_id' associated with it, but it is not properly inserting into another table or failing somewhere here. Hence the 'orders' table has the correct 'orders_id' but not the 'orders_table'.

 

Problem is, I can not figure out where or why.....

 

Does anyone have any ideas? I'm needing to cut-off off my previous server shortly and onto this new one. I have complete root access to the new server, so if you need more information, let me know.

Link to comment
Share on other sites

Ok, I have been debugging this for two and half days. On the plus side, I'm learning a lot about PHP and MySQL...

 

Anyways, the problem is, I can walk through the order process, and it appears to go through and the customer receives an e-mail receipt, however, it does not show up in the Admin section.

 

The odd thing about the E-mail invoice sent, it has an Order id of '0'..... Another odd thing about the e-mail receipt is that it does not show the sub-total, tax, or total. It shows all the items, but not the calculations.

 

Now looking into the database, I see the following:

Under the 'orders' table it does have the order with the correct 'orders_id' associated with it and it increments with each order. It does NOT however, have the credit card (encrypted of course) in the table.

 

Now under the 'orders_total' table they have the correct 'orders_id' up until the migration, then every test order I have done since then is '0'. So I'm assuming there is a problem somewhere during the checkout_process or checkout_success in that it has a correct 'orders_id' associated with it, but it is not properly inserting into another table or failing somewhere here. Hence the 'orders' table has the correct 'orders_id' but not the 'orders_table'.

 

Problem is, I can not figure out where or why.....

 

Does anyone have any ideas? I'm needing to cut-off off my previous server shortly and onto this new one. I have complete root access to the new server, so if you need more information, let me know.

 

To me it sounds like a datatype issue with the columns in your new installation.

http://www.thescripts.com/serversidescript...ysql/page1.html

 

Try to find a changle log on the database between versions. Or simply compare the structure of each table.

 

Also - on the working server, echo out each database insert in the checkout_process file, and then put in an exit(); before the redirect to checkout_success.

Then - take those statements and run them through the SQL window on the new server.

You'll be displayed the error in phpMyAdmin.

 

 

Corrie

Link to comment
Share on other sites

Thanks for the input, however, I can't really put in exits on the production server as it is quite busy.....

 

I am getting closer though, I installed the debug contrib (http://www.oscommerce.com/community/contributions,2575) on the new server that is having the problem.

 

I also logged all the all the SQL inserts into a logfile on the problem server...

 

Everything looks OK with the appropriate information, even the encryption of the credit card data, which I was concerned about earlier, making sure I had the GPG working correctly, but I do see the encrypted data in the log file.

 

This is exactly where the problem is, it has all the data to update the order, but the 'order_id' = 0. This is on the 'checkout_confirmation.php' page.

This also updating the 'orders_total' table with the 'order_id' of 0. There are several other updates, then I see a really odd query...

 

RESULT Resource id #128

QUERY select orders_id from orders where orders_id = '0'

 

RESULT Resource id #61

Then there is another query which does get the correct 'orders_id'. This happens after the above:

QUERY select orders_id from orders where customers_id = '2' order by date_purchased desc limit 1

RESULT Resource id #64

QUERY select products_id, products_name from orders_products where orders_id = '3085' order by products_name

 

Does anyone know how or what step of the checkout process does the orders_id get assigned? It appears this is where my problem is taking place. Also anyone know how to relate the "Resource id #" as part of the debug to the actual statements in the .php files? The first incident of the 'orders_id' in my sequential log file is 'Resource id #128', however later in the log file are earlier "Resource ID's".

 

Thanks!

You can see

 

Also - on the working server, echo out each database insert in the checkout_process file, and then put in an exit(); before the redirect to checkout_success.

Then - take those statements and run them through the SQL window on the new server.

You'll be displayed the error in phpMyAdmin.

Corrie

Link to comment
Share on other sites

Ok, figured it out... Amazingly simple, yet I don't quite understand why....

 

The configure.php was setup to use persistent mysql connections. Not sure why this would cause this behavior, but it did.

Link to comment
Share on other sites

Ok, figured it out... Amazingly simple, yet I don't quite understand why....

 

The configure.php was setup to use persistent mysql connections. Not sure why this would cause this behavior, but it did.

 

Thanks for letting us know.

 

You're doing all this testing, and installing contrib's on a *live* server ????!!

Why ?!!?

 

It's very simple to srt up a test environment with the same file structure and database. It should take you about ten minutes.

Install a 2nd instance of OSC into a new directory

Export the old database and import into the 2nd instance.

Download all your files locally

update the includes/configure.php files

Upload all the files.

 

Done.

 

Very risky business modifying, etc a live shop. Not to mention troubleshooting.

 

Just my 2 cents

 

Corrina

Link to comment
Share on other sites

Corrina,

All the testing was on the 'test' which was to be the new production server. After I took it as far as I could go, I needed to compare the SQL calls/results. So I took the code, which was minimal to log the queries to a log file, which was working fine on the test server and copied/pasted it into the exact locations on the production server. I did this at 3am when traditionally we only have like maybe two customers in that hour. It did not require a restart or other such activity.

 

The only testing was I put the authorizenet contribution in "Test" transaction mode, to make sure it would process a test credit card number. If a live order would come through, their card would still be logged into the database, so I would have to run it manually. Minimal risk, all major testing was on the 'new' server which was not in production yet.

 

As another note, does anyone know why the "persistence connections=true" is not working?

 

What finally led me to trying to turn this off was this support thread: http://www.oscommerce.com/forums/index.php?showtopic=157550

 

Thanks again for all the suggestions!

 

Thanks for letting us know.

 

You're doing all this testing, and installing contrib's on a *live* server ????!!

Why ?!!?

 

It's very simple to srt up a test environment with the same file structure and database. It should take you about ten minutes.

Install a 2nd instance of OSC into a new directory

Export the old database and import into the 2nd instance.

Download all your files locally

update the includes/configure.php files

Upload all the files.

 

Done.

 

Very risky business modifying, etc a live shop. Not to mention troubleshooting.

 

Just my 2 cents

 

Corrina

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...