Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

exclamation points in front of orders


brixters

Recommended Posts

Yes this is in the admin, it's in the part where I view my orders. It's the order list.

 

you need to check that file then for stray characters such as your !!

 

If you have any problems send me the code via PM - Have you edited the file at all?

Regards

 

Mark A Reynolds

Link to comment
Share on other sites

you need to check that file then for stray characters such as your !!

 

If you have any problems send me the code via PM - Have you edited the file at all?

Okay I have found it. I installed the contribution Purchase Without Account and that wants to shows !! in front of orders placed by a person that did not create an account. To make a long story short, the database query needed to be adjusted. Now it works fine.

Link to comment
Share on other sites

  • 2 months later...
Okay I have found it. I installed the contribution Purchase Without Account and that wants to shows !! in front of orders placed by a person that did not create an account. To make a long story short, the database query needed to be adjusted. Now it works fine.

 

PLEASE!!!! Please, please, please post the answer.

 

It does absolutely no good to anyone by telling us that you figured it out and then not telling us how. I just installed a contrib and now all of my orders have double exclamation points in front of them. How do I fix it? I have no idea how, but I do know that someone has the answer and it would be very appreciated if they posted the solution rather than telling us they found one.

-Dorian

Link to comment
Share on other sites

I just installed a contrib and now all of my orders have double exclamation points in front of them. How do I fix it?

This is not something that is broken that needs 'fixing'. If you installed PWA this is how it is supposed to work. It has to flag up which orders were created by users that did not create an account and it does that by using the two exclamation marks next to each such order.

Link to comment
Share on other sites

This is not something that is broken that needs 'fixing'. If you installed PWA this is how it is supposed to work. It has to flag up which orders were created by users that did not create an account and it does that by using the two exclamation marks next to each such order.

Yes, it does need fixing - something does. Every order in the Admin UI now has double exclamation points in front of it. PWA is supposed to mark ONLY the orders that did not have an account creation. It's a pity that brixters didn't post the solution to this problem. After all, how helpful is it for the rest of us when someone tells us that that they figured out the problem, but then doesn't tell us HOW they fixed it? That totally defeats the purpose of having forums. If he had just told us what he did to fix the problem, then me and every other person with this same problem would not be re-posting for help.

 

POST YOUR SOLUTIONS, PEOPLE! Don't simply tell us that you solved a problem. Tell us HOW!

-Dorian

Link to comment
Share on other sites

I've been looking at this more. It is definitely a bug. When you go into Admin and look at "Pending" orders, they all have the !! in front of them, regardless if they created an account or not.

 

Yet, when you go to "Orders" via Customers>Orders, it shows the !! only for the orders that where an account was not created.

 

So, yes... there is an error. I'm not certain how to fix it. The fact that bix didn't share it with us is strange.

 

Pete

I find the fun in everything.

Link to comment
Share on other sites

Yet, when you go to "Orders" via Customers>Orders, it shows the !! only for the orders that where an account was not created.

 

Unfortunately not for me. It doesn't matter how I navigate to the admin/orders.php screen whether the way you suggested or any of the numerous other ways, it still shows double exclamation points in front of every order. Every order for the past 3 years has !! in front of it. Definitely a bug!

-Dorian

Link to comment
Share on other sites

  • 2 weeks later...

Ignore my earlier post - just had to install PWA and it is a bug. Very easily fixed though:

 

Open /admin/orders.php and replace this:

 

$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";

 

with this:

 

$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.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC";

Link to comment
Share on other sites

  • 1 month later...

I just updated the query and it has removed the double exclamation points from every order. Even the orders the were placed without creating an account! So the bug still exists. It seems at this point the choices are...

 

1. Have !! in front of every order whether an account was created or not.

or

2. Have nothing in front of every order whether an account was created or not.

-Dorian

Link to comment
Share on other sites

there is only one place where the customers_id is missing and that is when the status filter is applied. Assuming you're using the version from 10/19/06 the code should be changed:

 

	if (isset($HTTP_GET_VARS['cID'])) {
  $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
  $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 . "' and ot.class = 'ot_total' order by orders_id DESC";
} elseif (isset($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 . "' and ot.class = 'ot_total' order by o.orders_id DESC";
} else {
  $orders_query_raw = "select o.orders_id, o.customers_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";
}

 

to

	if (isset($HTTP_GET_VARS['cID'])) {
  $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
  $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 . "' and ot.class = 'ot_total' order by orders_id DESC";
} elseif (isset($HTTP_GET_VARS['status'])) {
  $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
  $orders_query_raw = "select o.orders_id, o.customers_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 . "' and ot.class = 'ot_total' order by o.orders_id DESC";
} else {
  $orders_query_raw = "select o.orders_id, o.customers_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";
}

 

the other queries do include the customers_id

Link to comment
Share on other sites

I just updated the query and it has removed the double exclamation points from every order. Even the orders the were placed without creating an account! So the bug still exists. It seems at this point the choices are...

 

1. Have !! in front of every order whether an account was created or not.

or

2. Have nothing in front of every order whether an account was created or not.

You have not implemented the change correctly (or in the right place). That code was cut and pasted from a store that only puts !! in front of people that order goods without creating an account.

Link to comment
Share on other sites

You have not implemented the change correctly (or in the right place). That code was cut and pasted from a store that only puts !! in front of people that order goods without creating an account.

So where do you suppose things are wrong on my installation? I did the installation a second time and all orders continue to have !! in front.

-Dorian

Link to comment
Share on other sites

could be your database. Because the code logic is straight forward. Use phpmyadmin go to the orders table and sort them by the customers_id column. If that column shows 0 for all rows it means you have no longer orders from logged-in customers

Link to comment
Share on other sites

This is the complete code block from my /admin/orders.php from starting around line 355 and ending at 380. This fixed the problem for me as it queried the customer_id from the database (which the old query didn't) therefore the " if ($orders['customers_id'] == '0')" conditional block below was always false:

 

<?php
if (isset($HTTP_GET_VARS['cID'])) {
  $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
  $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 . "' and ot.class = 'ot_total' order by orders_id DESC";
} elseif (isset($HTTP_GET_VARS['status']) && is_numeric($HTTP_GET_VARS['status']) && ($HTTP_GET_VARS['status'] > 0)) {
  $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 . "' and ot.class = 'ot_total' order by o.orders_id DESC";
} else {
  $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.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, $orders_query_raw, $orders_query_numrows);
$orders_query = tep_db_query($orders_query_raw);
while ($orders = tep_db_fetch_array($orders_query)) {

// PWA BOF
 if ($orders['customers_id'] == '0') {$orders['customers_name'] = '<b>!!</b> ' . $orders['customers_name'];}
// PWA EOF
if ((!isset($HTTP_GET_VARS['oID']) || (isset($HTTP_GET_VARS['oID']) && ($HTTP_GET_VARS['oID'] == $orders['orders_id']))) && !isset($oInfo)) {

	$oInfo = new objectInfo($orders);
  }

  if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) {
	echo '			  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '\'">' . "\n";
  } else {
	echo '			  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '\'">' . "\n";
  }
?>

Link to comment
Share on other sites

What this block of code did was remove all the !! before the orders. I then placed a new test order without creating an account. It assigned me a customer number (one higher than the previous customer) and displays like any other order in the Admin UI. There's no way of telling that this order was done by someone that bypassed the create account process.

 

So what does this tell us if it's not assigning a 0 for the customer number (according to post #22 of this thread)?

-Dorian

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...