Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Customer Orders Missing! Please Help


tdupres

Recommended Posts

Hi

 

I am going out of my mind trying to figure this out. So I am giving away my prised elastic band gun,free of any charge, to whoever can solve this problem.

 

In the admin section i can see all my orders when I click on Customers/orders. But when I go to Customers/customers, select a customer and click on the orders button, this error message comes up:

 

1064 - You have an error in your SQL syntax 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.customers_id = '1' and o.orders_status = s.orders_status_id and s.language_id = '1' '

[TEP STOP]

 

Then in the catalog, when someone signs in and clicks on to order history, it shows no orders even if they have ordered in the past.

 

Please someone help me before I go crazy!

 

 

gun.gif

 

Its real shiny!

Link to comment
Share on other sites

It looks to me like you have an extra single quote at the end of that query.

 

Perhaps you made an alteration to the query (contrib or modification) and you accidentally interted an extra single quote.

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

BTW, that query resides in admin/orders.php

 

As far as the customers history goes, I'm not sure. Have you installed any contributions that might have messed with this?

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

open up orders.php, and search or 'select'. Find the one that resembles that query your posted above. Of course, there will be some variables embedded in it, but you should be able to locate that particular query. Once found, find the extra single quote at the end and delete it.

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

Hi

 

Tried that but no effect. Thanks any how!!

 

This is the code as is;

 

$orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, 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.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' ' order by orders_id DESC";

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

$status = tep_db_prepare_input($HTTP_GET_VARS['status']);

$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 s.orders_status_id = '" . (int)$status . "' order by o.orders_id DESC";

} 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 . "' order by o.orders_id DESC";

 

 

Any Ideas?

Link to comment
Share on other sites

No, none of those queries are the one you are looking for.

 

Try searching for 'select count(*)'

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

Right

 

I'm basically ignorant when it comes to code. I'm an html and flash man normally.

Does this look right?

 

Just picked up on this as it has that TABLE_ORDERS_STATUS_HISTORY thing in as that is the bit in the catalog that dose not work. The bit I'm worried about is this :

 

comments) values ('"

 

Is that right?

 

tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments) . "')");

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...