RE: OrderCheck v 1.3 Released

Justin WFCOMICS <[email protected]> 11 Sep 2003 18:10:52 -0000
Newsgroups gmane.comp.web.oscommerce.contributions
Message-ID <63d6cb4eee66ae4c359c743b160ac7a9@osCommerce-Forums>
This message was sent from: Contributions
http://forums.oscommerce.com/viewtopic.php?p=227999#227999
----------------------------------------------------------------

I've gotten farther with the OrderCheck contribution :).

1) The reason my admin wasn't rendering was becuase it was choking on this from admin/orders_check.php (around line 455): 

[code]<?php echo HEADING_TITLE_STATUS . ' ' . tep_draw_pull_down_menu('status', tep_array_merge(array(array('id' => '', 'text' => TEXT_ALL_ORDERS)), $orders_statuses), '', 'onChange="this.form.submit();"'); ?>[/code]

I had to change "tep_array_merge" to "array_merge" for the admin to work. So now the line looks like: 

[code]<?php echo HEADING_TITLE_STATUS . ' ' . tep_draw_pull_down_menu('status', array_merge(array(array('id' => '', 'text' => TEXT_ALL_ORDERS)), $orders_statuses), '', 'onChange="this.form.submit();"'); ?>[/code]

2) After that, like a lot of you, I had duplicate totals so I had to comment out one of these redundant lines: 

[code]$order_total_modules->process();[/code]

3) But NOW, I have another problem. Whenever I (actings as a test customer) tried to finish my checkout (when getting to the checkout_process.php page) I would get the following error... 

1062 - Duplicate entry '1' for key 1 

Then if I tried again... 

1062 - Duplicate entry '2' for key 1 

...where the problem was the checkout process was trying to use the highest (or max) orders_id from the holding table as the value to complete the order by trying to write an order with that order_id in the regular orders table. In the above example "1" and "2" already existed in key 1 (order_id), or in other words, I already had orders stored as Order Number:1 and 2. 

What is the best solution? 

Justin =)