Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Change "delete" on orders page


rabbitseffort

Recommended Posts

Ok, I have asked before but it has gone overlooked and I really need to know how to make this function--

 

I need to store orders that are marked shipped somewhere other than on the standard orders page since after many hundreds it gets quite cluttered.

 

So, what I want to do is have orders that are marked as shipped go to an orders2.php page that I could still access if need be -- I asume if I copy orders.php to make an orders2.php then there must be a way to send shipped orders to orders2.php--I do not want or need to delete the orders--I do however want them off the regular orders.php page

 

Someone Please help me accomplish this--I am sure many other osc users would like this as well! :thumbsup:

I loo very forward to someone helping! Maybe Monika, Vger, or WendyJames will answer my call!

"I must admit that I personally measure success in terms of the contributions an individual makes to her or his fellow human beings."

---Margaret Mead---

 

"The answer is never the answer. What's really interesting is the mystery. If you seek the mystery instead of the answer, you'll always be seeking. I've never seen anybody really find the answer -- they think they have, so they stop thinking. But the job is to seek mystery, evoke mystery, plant a garden in which strange plants grow and mysteries bloom. The need for mystery is greater than the need for an answer.

--Ken Kesey"

Link to comment
Share on other sites

You have the right idea in copying the orders.php file to be orders2.php.

 

Then in the original orders.php file, you would then need to modify the query that grabs the orders to look at the orders_status field and not grab anything that is shipped.

 

Then in orders2.php, modify the query to grab everything that has an orders_status of shipped (actually the orders_status_id value for shipped).

"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

thanks--it is exactly what I thought but it is a bit over my head--If you care to help more I would appreicate it --

basically how do I modify the query in orders.php and also then in orders2.php how would I set the query to grab the orders_status_id value for shipped?

 

Thanks a lot for the reply! I really hope to get this functioning!

"I must admit that I personally measure success in terms of the contributions an individual makes to her or his fellow human beings."

---Margaret Mead---

 

"The answer is never the answer. What's really interesting is the mystery. If you seek the mystery instead of the answer, you'll always be seeking. I've never seen anybody really find the answer -- they think they have, so they stop thinking. But the job is to seek mystery, evoke mystery, plant a garden in which strange plants grow and mysteries bloom. The need for mystery is greater than the need for an answer.

--Ken Kesey"

Link to comment
Share on other sites

You will first need to determine what the order_status_id is for the status of shipped. You can use PHPMyAdmin and look at the orders_status table.

 

In the example below, the shipped status has an id of 3.

 

Around line 354 of orders.php there should be:

	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.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);

 

In all of the

$orders_query_raw =

 

lines where is says:

where o.orders_status = s.orders_status_id

 

change it to be:

where o.orders_status != 3 and o.orders_status = s.orders_status_id

 

In your orders2.php file, do the same thing but the last part should be changed to:

where o.orders_status = 3 and o.orders_status = s.orders_status_id

 

and that should do it.

"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

Thanks--I will give this a try as soon as I have a few minutes--so this will make it so that when I hit "delte" on an order it will go to the order2.php page or is it so that when one is marked "shipped" they will go there? If I understand right it will be the latter--and if so what about all the ones that are already marked as shipped? Will they go there or will I have to use phpmyadmin to send them there?

 

Thanks again for all your help--I really appreciate it!

"I must admit that I personally measure success in terms of the contributions an individual makes to her or his fellow human beings."

---Margaret Mead---

 

"The answer is never the answer. What's really interesting is the mystery. If you seek the mystery instead of the answer, you'll always be seeking. I've never seen anybody really find the answer -- they think they have, so they stop thinking. But the job is to seek mystery, evoke mystery, plant a garden in which strange plants grow and mysteries bloom. The need for mystery is greater than the need for an answer.

--Ken Kesey"

Link to comment
Share on other sites

The above has nothing to do with the Delete button.

 

When the orders.php page is displayed, all orders that do not have a status of Shipped will be displayed. When you edit an order and set it's status to Shipped it will automatically no longer be displayed.

 

When the orders2.php page is displayed, all orders that have a status of Shipped will be displayed.

"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

Hi again Jim--thanks for the reply again! I will work on this today--I expect it to take all of 1 minute to accomplish--I really appreciate all your help with this!

"I must admit that I personally measure success in terms of the contributions an individual makes to her or his fellow human beings."

---Margaret Mead---

 

"The answer is never the answer. What's really interesting is the mystery. If you seek the mystery instead of the answer, you'll always be seeking. I've never seen anybody really find the answer -- they think they have, so they stop thinking. But the job is to seek mystery, evoke mystery, plant a garden in which strange plants grow and mysteries bloom. The need for mystery is greater than the need for an answer.

--Ken Kesey"

Link to comment
Share on other sites

Just to say thanks to you again--it worked like a charm and only took about a minute to do. And all the ones already marked as shipped went to the order2 page like they should. Some of the headings arent right on orders2 so I need to define a language page also, but that is easy.

 

This is so handy--I cant thank you enough!

"I must admit that I personally measure success in terms of the contributions an individual makes to her or his fellow human beings."

---Margaret Mead---

 

"The answer is never the answer. What's really interesting is the mystery. If you seek the mystery instead of the answer, you'll always be seeking. I've never seen anybody really find the answer -- they think they have, so they stop thinking. But the job is to seek mystery, evoke mystery, plant a garden in which strange plants grow and mysteries bloom. The need for mystery is greater than the need for an answer.

--Ken Kesey"

Link to comment
Share on other sites

I made this into a full contribution with all needed mods to files and included files--full download can be had HERE

 

Most credit goes to Daemonj and is so stated with the contribution.

"I must admit that I personally measure success in terms of the contributions an individual makes to her or his fellow human beings."

---Margaret Mead---

 

"The answer is never the answer. What's really interesting is the mystery. If you seek the mystery instead of the answer, you'll always be seeking. I've never seen anybody really find the answer -- they think they have, so they stop thinking. But the job is to seek mystery, evoke mystery, plant a garden in which strange plants grow and mysteries bloom. The need for mystery is greater than the need for an answer.

--Ken Kesey"

Link to comment
Share on other sites

Glad to have been of help and happy to hear that we got you going.

"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

Archived

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

×
×
  • Create New...