Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Order Process Errors


royalfunk

Recommended Posts

We have a store that is highly modified and has been running perfectly now for several months. Now all of a sudden there is a big problem...

 

When a customer puts products into their cart and goes to checkout, everything appears to function properly until the Checkout_Confimation page. Attached is the visual example. Basically the products are there as line items. For the example herein, there are two products in the shopping cart. Unfortunately there is no quantity, product name, or price for any of the products though. This ultimately results in an empty order.

 

 

 

Has this happened to anyone else? Anyone have an idea at least of what file may be having errors? Your help is greatly appreciated.

 

-Aaron

Picture-1.gif

Link to comment
Share on other sites

Could this possibly be a session-related problem? One thing I have noticed recently is that it does not appear that the session is being carried throughout the customer's visit. I have tried emptying the sessions table in the database as well as several other things. It also seems odd that even though the tax group is set to '0', the tax header is showing up on the checkout_confirmation page. Any help wou;d be great, this is a desperate situation. Thanks.

 

 

-Aaron

Link to comment
Share on other sites

have you made any changes to the code? any at all no matter how small (small change shave a tendancy to create big problems)

 

has the server been upgraded in anyway, New Apache, New php, etc etc etc

 

things just "start happening" with out a cause, something changed in the database, server, or code to start this problem

Link to comment
Share on other sites

Thanks for your reply. Actually I tried replacing our custom store with a default install of osCommerce, still leaving the database in tact. I get the same error, so I thought it had to be a database error. I restored the database to a day before the errors started, and that appears to work at first, but then the same errors start again after an order is placed. Now what's even weirder is that even though the tax zone is set to '0', the tax header comes up rathe than the header that is supposed to come up if you choose not to display tax. Seems all messed up to me.

 

Any other advice/insight that you may have?

 

-Aaron

Link to comment
Share on other sites

Yes, exactly. Yesterday I replaced the following files/directories and all seemed to work OK:

 

catalog/includes/classes/order.php

catalog/includes/classes/order_total.php

catalog/includes/modules/order_total

 

Logged in under three different accounts on two different computers. Placed two test orders and both came through OK. A real customer placed an order this morning and after we received it, the problem started over again. This is a different customer than the last one who started this issue.

 

The shopping cart module is working OK (or so it seems). All of the info in the shopping cart box and page are correct. On the checkout_confirmation page it shows a line for each product, but each is blank. You can see an example in the picture I attached on the first post I made.

 

I'm going NUTS. I have been working on this non-stop now since last Thursday.

 

Thanks,

Aaron

Link to comment
Share on other sites

I pinpointed the problem down to the catalog/includes/classes/order.php file. It seems that all of a sudden for some reason our site/database does not like the following two blocks of code that were added to this file for use with the Separate Pricing Contribution.

 

//Separate Pricing Mod
         global $customer_id;

$customer_group_id_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . " where customers_id = '". $customer_id . "'");

$customer_group_id = tep_db_fetch_array($customer_group_id_query);

 if ($customer_group_id['customers_group_id'] != '0'){	

 $orders_customers_price = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '". $customer_group_id['customers_group_id'] . "' and products_id = '" . $products[$i]['id'] . "'");     	 

 if ($orders_customers = tep_db_fetch_array($orders_customers_price)){	

   $this->products[$index] = array('price' => $orders_customers['customers_group_price'],

                                   'final_price' => $orders_customers['customers_group_price']);

 }                              

}
//eof Separate Pricing Mod

 

//Separate Pricing Mod
         global $customer_id;

$customer_group_id_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . " where customers_id = '". $customer_id . "'");

$customer_group_id = tep_db_fetch_array($customer_group_id_query);

 if ($customer_group_id['customers_group_id'] != '0'){

 $orders_customers_price = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '". $customer_group_id['customers_group_id'] . "' and products_id = '" . $products[$i]['id'] . "'");

 $orders_customers = tep_db_fetch_array($orders_customers_price);

   if ($orders_customers = tep_db_fetch_array($orders_customers_price)) {	

   $this->products[$index] = array('price' => $orders_customers['customers_group_price'],

                                       'final_price' => $orders_customers['customers_group_price'] + $cart->attributes_price($products[$i]['id']));

   }

 }
//eof Separate Pricing Mod

 

 

The only 2 things that still puzzle me are:

1) The site operates in the same manner, seemingly, without those two blocks of code

2) The site operated perfectly fine for several months and now all of a sudden this file, which went unmodified that whole time, now does not work with the above code left in.

 

-Aaron

Link to comment
Share on other sites

ok so lets look at this from commonalites

 

1> the "test" accounts, were they assinged to a "group" that this mods uses?

 

2> Where the Regular Customers?

 

is the awnsers are no and yes, then

 

3> was there a price set up for those Groups

Link to comment
Share on other sites

1> the "test" accounts, were they assinged to a "group" that this mods uses?

Yes.

 

2> Where the Regular Customers?

Yes (if you meant "were they regular customers)

 

3> was there a price set up for those Groups

Yes.

 

Thanks for your help with this,

Aaron

Link to comment
Share on other sites

The_ancient,

 

I found out what was wrong this whole time and now I feel dumb. It was your trio of questions that spurred me to look into it. The last time I uploaded the replacement file for the products_groups table I accidentally made two entries for each product for each price group instead of simply adding only rows which were not already present. The checkout confirm page was getting confused because it didn't know which value to use (I assume).

 

Thanks for your help. Hopefully the site is now fixed for good!

 

Aaron

Link to comment
Share on other sites

The_ancient,

 

I found out what was wrong this whole time and now I feel dumb. It was your trio of questions that spurred me to look into it. The last time I uploaded the replacement file for the products_groups table I accidentally made two entries for each product for each price group instead of simply adding only rows which were not already present. The checkout confirm page was getting confused because it didn't know which value to use (I assume).

 

Thanks for your help. Hopefully the site is now fixed for good!

 

Aaron

yep, my saying still hold true, Simple things alwasy bite you in the ass

 

My favorite is spending hours writing hundreds of lines of code, only to get a parse error you can not find, got to love the "}"

 

 

 

 

:rolleyes: :D

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...