Irin Posted March 7, 2006 Share Posted March 7, 2006 Incidentally, I'm not saying it's not happening with other versions, just that I have seen something like this with 1.75. What version of PHP are you using? Hi djmonkey1, I'm on Windows server and PHP Version: 4.3.11. As I said earlier the comments were always displayed twice starting from much earlier versions, it's not that it's just started with 1.75 release. Irina. Quote Link to comment Share on other sites More sharing options...
custodian Posted March 7, 2006 Share Posted March 7, 2006 Installed the 2 Mar 2006 release. Buttons show up, everything look normal. Click edit (outside the invoice or from within, doesn't matter) , which take me to https://www.mydomain.com/admindir/edit_orders.php?oID=65 And it's blank. I didn't touch the edit_order.php as it is a new file with the package. What now? My logs show PHP Fatal error: Call to undefined function tep_field_exists() in /usr/home/beth/public_html/[admindir]/edit_orders.php on line 29, referer: https://www.memorylaneprimitives.com/[admindir]/orders.php?page=2&oID=13 line 29 is // New "Status History" table has different format. $OldNewStatusValues = (tep_field_exists(TABLE_ORDERS_STATUS_HISTORY, "old_value") && tep_field_exists(TABLE_ORDERS_STATUS_HISTORY, "new_value")); Suggestions Quote My Contributions Henry Smith Link to comment Share on other sites More sharing options...
djmonkey1 Posted March 7, 2006 Share Posted March 7, 2006 My logs show PHP Fatal error: Call to undefined function tep_field_exists() in /usr/home/beth/public_html/[admindir]/edit_orders.php on line 29, referer: https://www.memorylaneprimitives.com/[admindir]/orders.php?page=2&oID=13 line 29 is // New "Status History" table has different format. $OldNewStatusValues = (tep_field_exists(TABLE_ORDERS_STATUS_HISTORY, "old_value") && tep_field_exists(TABLE_ORDERS_STATUS_HISTORY, "new_value")); Suggestions The function tep_field_exists is defined at the bottom of the file edit_orders.php: // Function : tep_field_exists // Arguments : table table name field field name // Return : true/false // Description : Function to check the existence of a database field function tep_field_exists($table,$field) { $describe_query = tep_db_query("describe $table"); while($d_row = tep_db_fetch_array($describe_query)) { if ($d_row["Field"] == "$field") return true; } return false; } Try uploading the file again. If that doesn't work, move that function to the top of the file. Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
custodian Posted March 8, 2006 Share Posted March 8, 2006 The function tep_field_exists is defined at the bottom of the file edit_orders.php: // Function : tep_field_exists // Arguments : table table name field field name // Return : true/false // Description : Function to check the existence of a database field function tep_field_exists($table,$field) { $describe_query = tep_db_query("describe $table"); while($d_row = tep_db_fetch_array($describe_query)) { if ($d_row["Field"] == "$field") return true; } return false; } Try uploading the file again. If that doesn't work, move that function to the top of the file. It worked, but only showed first field. I put all the functions at the top of the file right before // New "Status History" and everything works now. Thank! - BTW, any idea why this would work for some people and not for others? Just curious in the event something else wouldn't work for me - it might be a trick to try when troubleshooting. Quote My Contributions Henry Smith Link to comment Share on other sites More sharing options...
djmonkey1 Posted March 8, 2006 Share Posted March 8, 2006 It worked, but only showed first field. I put all the functions at the top of the file right before // New "Status History" and everything works now. Thank! - BTW, any idea why this would work for some people and not for others? Just curious in the event something else wouldn't work for me - it might be a trick to try when troubleshooting. PHP version maybe? Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
djmonkey1 Posted March 9, 2006 Share Posted March 9, 2006 Hi djmonkey1, I'm on Windows server and PHP Version: 4.3.11. As I said earlier the comments were always displayed twice starting from much earlier versions, it's not that it's just started with 1.75 release. Irina. Irina- Please describe in greater detail the problem you're having with multiple comments being displayed. For instance, on a brand new order, the first time you view the order using Order Editor, how many comments are displayed (should be only one, with default status)? How many comments are in the database for an order immediately after the placement of that order? Do all these multiple comments show up when you view the order through orders.php? If they're being created by Order Editor, how many and in what circumstances? For instance, does it matter if you check the "Notify customer" and/or "Send comments" boxes, or if you select a new status for the order? If so, how? Sorry for all the questions, but it's hard to figure out what exactly is happening when I can't see it for myself. Cheers, Stew Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
djmonkey1 Posted March 9, 2006 Share Posted March 9, 2006 So, apparently $RunningTotal += $ot_value / $order->info['currency_value']; I did a little research and parsed the meaning of "+=". It means, in this case, that $RunningTotal is equal to the value of $RunningTotal (initially set at zero) plus the $ot_value of every $ot_class listed in the or string, plus any others laying around. So it's pretty simple- if it isn't listed as a value somewhere in the order_totals table, it's not going to be added into $RunningTotal. At least, it shouldn't be. Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
p51mustang Posted March 9, 2006 Share Posted March 9, 2006 Just wanted to say thank you to djmonkey1 for stepping up to the mark and helping to support this wonderful little orphaned contribution. :thumbsup: :) Quote Link to comment Share on other sites More sharing options...
djmonkey1 Posted March 9, 2006 Share Posted March 9, 2006 Just wanted to say thank you to djmonkey1 for stepping up to the mark and helping to support this wonderful little orphaned contribution. :thumbsup: :) You're welcome! v2.0 is in the works... Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
djmonkey1 Posted March 9, 2006 Share Posted March 9, 2006 Hi djmonkey1, I'm so sorry, I forgot to mention that I use "Step-By-Step Manual Order Entry" along with edit orders. So, first I go to Create Order, enter the customer's details and then I'm going to edit_orders.php page where I can enter the products for the order. And here is where I get all this fields: Sub-Total Discount Coupons Shipping Tax Total Sorry if I didn't explain myself as I should. For me Edit Orders and Step-By-Step Manual Order Entry just like one inseparable contribution. Is my question still appropriate here or I need to ask it in the different support forum? Thanks, Irina. I missed this when you originaly posted it- it's possible your issue is related somehow with the manual order entry contribution, but it seems unlikely to be something to do with interaction between the two, as I would expect them to work independently. Maybe the order entry file is doing something a little weird when it creates the order? Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
djmonkey1 Posted March 9, 2006 Share Posted March 9, 2006 I could use some feedback concerning charging tax on shipping. Is this common? When it's done, what tax rate do you use? Can it or does it vary by order? The code that exists for adding tax onto shipping is problematic at best. I'd like to have it available as an option for people who do charge tax on shipping, however I need to have a way of calculating it that makes sense. Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
Irin Posted March 9, 2006 Share Posted March 9, 2006 (edited) Irina- Please describe in greater detail the problem you're having with multiple comments being displayed. For instance, on a brand new order, the first time you view the order using Order Editor, how many comments are displayed (should be only one, with default status)? How many comments are in the database for an order immediately after the placement of that order? The status of all new orders is Pending. In order_edit there is only Pending status listed once with no comments to the order. Do all these multiple comments show up when you view the order through orders.php? Yes, all multiple comments listed on orders.php. If they're being created by Order Editor, how many and in what circumstances? For instance, does it matter if you check the "Notify customer" and/or "Send comments" boxes, or if you select a new status for the order? If so, how? It doesn't matter if "Notify customer" and/or "Send comments" boxes checked or unchecked or a new status for an order selected, I'm still getting multiple comments after clicking Update. And I don't know why, but after I edit any order, I'm losing products in at least two of previous orders. Edited March 9, 2006 by Irin Quote Link to comment Share on other sites More sharing options...
djmonkey1 Posted March 9, 2006 Share Posted March 9, 2006 And I don't know why, but after I edit any order, I'm losing products in at least two of previous orders. That should be fixed by applying this patch: I had the same problem (using v1.75) - when updating an order, entries belonging to different orders would disappear from the table ORDERS_PRODUCTS. I think the culprits are lines 323: $Query = "delete from " . TABLE_ORDERS_PRODUCTS . " where orders_products_id = '$orders_products_id';"; and 332: $Query = "delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_products_id = '$orders_products_id';"; I changed them to $Query = "delete from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$oID . "' and orders_products_id = '$orders_products_id';"; and $Query = "delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$oID . "' and orders_products_id = '$orders_products_id';"; So far it seems to work fine. Giirov Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
custodian Posted March 9, 2006 Share Posted March 9, 2006 PHP version maybe? Well it's the latest (last time I checked) PHP Version: 5.1.2 (Zend: 2.1.0) Quote My Contributions Henry Smith Link to comment Share on other sites More sharing options...
djmonkey1 Posted March 10, 2006 Share Posted March 10, 2006 The status of all new orders is Pending. In order_edit there is only Pending status listed once with no comments to the order. Try this: Find, starting at about line 203 /*old way before nana came in and fixed things if(!$CommentsWithStatus) { $UpdateOrders .= ", comments = '" . tep_db_input($comments) . "'"; } $UpdateOrders .= " where orders_id = '" . tep_db_input($oID) . "';"; tep_db_query($UpdateOrders); $order_updated = true; */ // if(!$CommentsWithStatus) // { //$UpdateOrders .= ", comments = '" . tep_db_input($comments) . "'"; // } $UpdateOrders .= " where orders_id = '" . tep_db_input($oID) . "';"; tep_db_query($UpdateOrders); tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . tep_db_input($oID) . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments) . "')"); $order_updated = true; /// end fix by nana and replace it with this: if(!$CommentsWithStatus) { $UpdateOrders .= ", comments = '" . tep_db_input($comments) . "'"; } $UpdateOrders .= " where orders_id = '" . tep_db_input($oID) . "';"; tep_db_query($UpdateOrders); $order_updated = true; Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
djmonkey1 Posted March 10, 2006 Share Posted March 10, 2006 (edited) Well it's the latest (last time I checked)PHP Version: 5.1.2 (Zend: 2.1.0) That would do it. I imagine that the others reporting this problem have a similar configuration. Hopefully the updates in 2.0 will take care of this for future users. Edited March 10, 2006 by djmonkey1 Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
Irin Posted March 10, 2006 Share Posted March 10, 2006 Try this: Find, starting at about line 203 /*old way before nana came in and fixed things if(!$CommentsWithStatus) { $UpdateOrders .= ", comments = '" . tep_db_input($comments) . "'"; } $UpdateOrders .= " where orders_id = '" . tep_db_input($oID) . "';"; tep_db_query($UpdateOrders); $order_updated = true; */ // if(!$CommentsWithStatus) // { //$UpdateOrders .= ", comments = '" . tep_db_input($comments) . "'"; // } $UpdateOrders .= " where orders_id = '" . tep_db_input($oID) . "';"; tep_db_query($UpdateOrders); tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . tep_db_input($oID) . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments) . "')"); $order_updated = true; /// end fix by nana and replace it with this: if(!$CommentsWithStatus) { $UpdateOrders .= ", comments = '" . tep_db_input($comments) . "'"; } $UpdateOrders .= " where orders_id = '" . tep_db_input($oID) . "';"; tep_db_query($UpdateOrders); $order_updated = true; Well... it works at my site. The comments are updated just once, doesn't matter if "Notify customer" and/or "Send comments" boxes checked or unchecked or a new status for an order selected. Great job :thumbsup: Thanks a lot for all your help. Quote Link to comment Share on other sites More sharing options...
jal2007 Posted March 10, 2006 Share Posted March 10, 2006 Hi, I used the lastest contribution version 1.81. When I tried to add a product, it came up with this error: Fatal error: Call to undefined function: link_post_variable() in /domain/admin/edit_orders.php on line 1269. Any Ideas? It worked fine with 1.80 Thanks for your help. Regards Quote Link to comment Share on other sites More sharing options...
jal2007 Posted March 10, 2006 Share Posted March 10, 2006 Hi, I used the lastest contribution version 1.81. When I tried to add a product, it came up with this error: Fatal error: Call to undefined function: link_post_variable() in /domain/admin/edit_orders.php on line 1269. Any Ideas? It worked fine with 1.80 Thanks for your help. Regards Quote Link to comment Share on other sites More sharing options...
Guest Posted March 10, 2006 Share Posted March 10, 2006 Hi, Here is my 10 cents worth. I have installed Order editor V1.8, removed ver 1.75. I find it is adding new additonal products, allows me to add new lines to Discount, Shipping and Total and upon pressing update it is calculating the tax But when I goto section 5. Status and Notification, its not recording or informing the customer. Any ideas. Regards Quote Link to comment Share on other sites More sharing options...
thedream Posted March 10, 2006 Share Posted March 10, 2006 Hi there, I Have asked to my super mathematician Brother, about the tax problem, and we have found a way to have an idea on the debugging but not the solution: the edit_orders.php file doesn't take on consideration taht it could have mora than one tax. For example in FRance we have the 5.5% and the 19.5% taxes. In my example the error was when I update the quantity value afer editing, the file take the tax at 19.6% of the product (that normally had a 5.5% tax), and add it to the others taxes computed (as the delivery taxes) and slip them by 2, because there are two fields. I am trying to fid that on the code, but I didn't write it, so it's hard. Hope this post can help, the developper... Quote osCommerce 2.2 MS2 in 6 languages TVA Intracomm Numbers of visitors online Who's online Enhancement .... Link to comment Share on other sites More sharing options...
djmonkey1 Posted March 11, 2006 Share Posted March 11, 2006 Hi, I used the lastest contribution version 1.81. When I tried to add a product, it came up with this error: Fatal error: Call to undefined function: link_post_variable() in /domain/admin/edit_orders.php on line 1269. Any Ideas? It worked fine with 1.80 Thanks for your help. Regards Delete all the lines that have link_post_variable in them. Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
djmonkey1 Posted March 11, 2006 Share Posted March 11, 2006 Hi, Here is my 10 cents worth. I have installed Order editor V1.8, removed ver 1.75. I find it is adding new additonal products, allows me to add new lines to Discount, Shipping and Total and upon pressing update it is calculating the tax But when I goto section 5. Status and Notification, its not recording or informing the customer. Any ideas. Regards I haven't had a problem with this section, however, the way it's written right now you have to select a new status in order for comments to be sent (ie you can't just post new comments with the same status). This is something I'd like to change in the future but I haven't looked at it yet. Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
djmonkey1 Posted March 11, 2006 Share Posted March 11, 2006 Hi there, I Have asked to my super mathematician Brother, about the tax problem, and we have found a way to have an idea on the debugging but not the solution: the edit_orders.php file doesn't take on consideration taht it could have mora than one tax. For example in FRance we have the 5.5% and the 19.5% taxes. In my example the error was when I update the quantity value afer editing, the file take the tax at 19.6% of the product (that normally had a 5.5% tax), and add it to the others taxes computed (as the delivery taxes) and slip them by 2, because there are two fields. I am trying to fid that on the code, but I didn't write it, so it's hard. Hope this post can help, the developper... Are you saying that on checkout there are multiple entries input into the orders_total table with a class of "ot_tax"? Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
djmonkey1 Posted March 12, 2006 Share Posted March 12, 2006 As I've mentioned a few times recently I'm working on v2.0 of Order Editor. The changelog entry currently looks like this (not all of these steps have been completed): Dropped support for MS1(ie file is written to work with a stock install of osC 2.2 MS2) Updated use of $HTTP_*_VARS to $_* (this doesn't play well with versions of PHP prior to 4.1) Made code fully compliant with the standard of register_globals being set to OFF (as of PHP 4.2)(no worries- works the same with globals ON!) Moved file specific functions to top of file for logical arrangement and to fix bug where certain users saw a call to undefined function error Deleted unused function tep_get_country_iso_code_2 Changed code so that, by default, tax is not applied to shipping and other fees. The code to allow for this is still included. Rewrote all database write queries in a single standard format Replaced all instances of 'print' with 'echo' to comply with instructions found in osC STANDARD file Placed the major foreach loops inside if conditionals. This allows for unique situations such as updating an order that has zero products by preventing the script from failing on invalid foreach arguments that previously would have occurred in such situations Added ability to add tax onto an order that was originally calculated, during the checkout process, without any tax Includes semi-updated language definition files for all included languages (Danish, Dutch, English, French, German, Italian)- the entries all exist, unfortunately my language skills are lacking so many of the new entries are written in English Fixed a bug where Order Editor would not properly display and upon updating the order would delete the Estimated Delivery Date as quoted by the UPSXML module Fixed a bug where the specials price was always being used when adding a product regardless of whether or not the special was active Standardized the language used in file code (English) Deleted an incredible amount of extraneous and/or unneccessary code Moved the included css code to the stylesheet Standardized the currency format seen in order totals, etc, by using the currencies->format function Rolled what had been update steps 1.4 and 1.5 into one step Many other minor changes that I've forgotten to list If anybody has anything they'd like to also see included in the file and/or bugs to report in version 1.8x that aren't addressed in this list, please post here. Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.