Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Archiving Orders? Duplicate Admin page?


chowpay

Recommended Posts

Hello,

 

I got an interesting delimma,

 

I moved a client to an os2.2 store out of an old 1.3. The new store is now fully functional and takeing in new orders and new customers. For Archive reasons the customer wants to look up old orders and old customers.

 

 

If you go in to store/admin and under customers there is a Custmers and Orders link. I want it to look like this

 

Customers

Customers_AR

Orders

Orders_AR

 

So far here are my changes so far.

 

new mysql table set now includes these tables which are the tables from my old shop and renamed them as such:

TABLE_ORDERS_AR

TABLE_ORDERS_STATUS_AR

TABLE_ORDERS_STATUS_HISTORY_AR

TABLE_ORDERS_TOTAL_AR

TABLE_CUSTOMERS_AR

 

 

I created orders_AR.php file (which is a direct copy of admin/orders.php) with these modified table REFERENCES (ORIGINAL = NEW REFERENCE):

 

TABLE_ORDERS =TABLE_ORDERS_AR

TABLE_ORDERS_STATUS =TABLE_ORDERS_STATUS_AR

TABLE_ORDERS_STATUS_HISTORY =TABLE_ORDERS_STATUS_HISTORY_AR

TABLE_ORDERS_TOTAl =TABLE_ORDERS_TOTAL_AR

TABLE_CUSTOMERS =TABLE_CUSTOMERS_AR

 

This was also defined in database_tables.php

// ARCHIVE TABLES

define('TABLE_ORDERS_AR', 'orders_AR');

define('TABLE_ORDERS_STATUS_AR', 'orders_status_AR');

define('TABLE_ORDERS_STATUS_HISTORY_AR', 'orders_status_history_AR');

define('TABLE_ORDERS_TOTAL_AR', 'orders_total_AR');

define('TABLE_CUSTOMERS_AR', 'customers_AR');

 

 

 

What else do I have to edit to make this work? As of right now if i go to www.mystore.com/catalog/admin/orders_AR.php it displays the AR orders but if I click on any of them it points back to www.mystore.com/catalog/admin/orders.php=...... Go figure?

 

Any help would be greatly appreciated. This may also be useful for others who need to archive old orders/customers

 

 

THANKS

Link to comment
Share on other sites

Great idea,

I will need to do something like this in the future. So I will follow your progress.

 

My first guess is it can't find the oID

 

The script is calling application_top.php which calls a bunch of other scripts, including admin/includes/database_tables.php

 

I only glanced at it, looks like you will need to make sure your new redefined table info gets to the other php scripts, then you should be ok.

 

this little script may help

It will echo the variables so you can see what is sent or missing

Just put it in the admin/includes/footer.php

 

<?php
// use this code to print to the screen the global variables
// edit the font color, default is very light so you could run it on a live site

 function px(&$arr, $arr_name)
{
print "<table bgcolor=White><tr><td><font size=3 color=#e1e1e1>";
if (sizeof($arr))
{
  print "---------- <br>";
  print $arr_name . "<br>";
}


foreach($arr as $key => $v)
{
  print " ".$key." -> '".$v."'<br>";
}
print "</font></td></tr></table>";
}
// edit this area, comment or uncomment the following variables to show
// default is set to show Get and Post
px($_GET, "GET");
px($_POST, "POST");
//px($_COOKIE, "COOKIE");
//px($_SERVER, "SERVER");
//px($_ENV, "ENV");
//px($_FILES, "FILES");
?>

Link to comment
Share on other sites

Awesome I will give this a shot today! I made several other changes last night but still not much progress I'll post those shortly.

 

I think I will also start comparing the code between the 2 versions of oscom there may be some differences I cant see in the admin tool.

Link to comment
Share on other sites

Your guess is correct, its finding order oids from os2.2's db instead of the oids from os1.3's dbs.

 

 

Added these to filenames_AR.php:

define('FILENAME_CONFIGURATION', 'configuration_AR.php');//

define('FILENAME_CUSTOMERS', 'customers_AR.php');//

define('FILENAME_ORDERS', 'orders_AR.php');//

 

Database_tables.php Added:

define('TABLE_CONFIGURATION_AR', 'configuration_AR');

define('TABLE_CONFIGURATION_GROUP_AR', 'configuration_group_AR');

Link to comment
Share on other sites

Let me know if you solve it.

 

If you need so help let me know I may have some time tonight

 

 

Ah nice I can totally use some help. Let me log all my changes and I'll shoot you over a file

 

Thanks again.

 

Theres more I need to change im just not sure what it is to get that "edit" part to work

Link to comment
Share on other sites

ok, i'm looking at it now....

 

Do you need to edit the old orders?

What will you do with the old orders?

Will you want the old orders referenced in any reporting?

 

I was thinking more on the lines of rewriting the orders.php script to only report (not edit) the old orders. This way we can remove all calls outside the script and not have to worry about mixing the old and new.

 

For my needs I was thinking of making a full year separate copy of the database of the past years orders and setup 2005_orders.php, 2006_orders, php, etc... Instead of setting up new tables. Adding new tables - defeats my purpose of archiving the orders by removing them to a DB not used by the public.

 

I will be working on the script in a different direction.

 

Let me know your thoughts

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...