Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

jhilgeman

NEW! Complete Order Editing Tool!

Recommended Posts

Version: 1.75a

Oscommerce version: Fresh installation of oscommerce 2.2 Milestone 2

Bug description: Product inventory bug. If I delete the first product in an order by setting the quantity to zero the inventory changes by -1, BUT, edit_orders.php also changes the second products inventory by -1.

The secound product is still visual in the order but the inventory has been changed by -1.

 

Does anyone have any id?as how to fix this problem?

 

Also tried earlier versions of edit_orders.php but they seems to have the same problem.

I tried to isolate the problem lines, and I think this is the problem lines:

 

} else { // b.) null quantity found --> delete

 

$Query = "delete from " . TABLE_ORDERS_PRODUCTS . " where orders_products_id = '$orders_products_id';";

 

 

tep_db_query($Query);

$order = tep_db_fetch_array($order_query);

 

if ($products_details["qty"] != $order['products_quantity']){

$quantity_difference = ($products_details["qty"] - $order['products_quantity']);

tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity - " . $quantity_difference . ", products_ordered = products_ordered + " . $quantity_difference . " where products_id = '" . (int)$order['products_id'] . "'");

}

 

$Query = "delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_products_id = '$orders_products_id';";

 

 

tep_db_query($Query);

Share this post


Link to post
Share on other sites
Not at my side, I have ask for help, but no body can help me? :'( Will ask again:

 

Please could somebody help me I have this problem no how to fix it. I use the latest version:

 

:blush: I use OSC 2 ms2

 

You have to go back over the install instructions step by step and make sure you didn't miss something.

 

Also try a different version. I recommend v1.73.


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.

Share this post


Link to post
Share on other sites
Version: 1.75a

Oscommerce version: Fresh installation of oscommerce 2.2 Milestone 2

Bug description: Product inventory bug. If I delete the first product in an order by setting the quantity to zero the inventory changes by -1, BUT, edit_orders.php also changes the second products inventory by -1.

The secound product is still visual in the order but the inventory has been changed by -1.

 

Does anyone have any id?as how to fix this problem?

 

Also tried earlier versions of edit_orders.php but they seems to have the same problem.

I tried to isolate the problem lines, and I think this is the problem lines:

 

} else { // b.) null quantity found --> delete

 

$Query = "delete from " . TABLE_ORDERS_PRODUCTS . " where orders_products_id = '$orders_products_id';";

 

 

tep_db_query($Query);

$order = tep_db_fetch_array($order_query);

 

if ($products_details["qty"] != $order['products_quantity']){

$quantity_difference = ($products_details["qty"] - $order['products_quantity']);

tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity - " . $quantity_difference . ", products_ordered = products_ordered + " . $quantity_difference . " where products_id = '" . (int)$order['products_id'] . "'");

}

 

$Query = "delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_products_id = '$orders_products_id';";

 

 

tep_db_query($Query);

 

A couple months ago I ran into a problem where suddenly and for reasons I could never figure out, the items from the four most recent orders in my database were all deleted. At the time I was working on the Order Editor quite a bit, and so suspected the contribution, but it only happened one time and I never found a reason for this.

 

I'm using a customized v1.73 right now and am not having any problems that I'm aware of.

 

However, I have run into, quite recently, a strange bug where the format_id of the billing address for various orders is set at 0 instead of 2. I'm not sure when this is happening (it might be set this way during checkout for some bizarro reason- I have had this problem with PayPal Express Checkout), and have not linked this to Order Editor, but it's possible.

 

Order Editor is a very powerful, and, hence, very dangerous tool. You can permanently modify/delete all sorts of information with a single click. It should come with a warning that you should backup your database any time you want to use it.

 

Personally I think a later version should have a logging function where any and all modified data can be saved somewhere for later retrieval if necessary.


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.

Share this post


Link to post
Share on other sites
Guest

Hi

 

I have installed order editor 1.75, and works a treat.

 

the only downside is when an order is amended (via the admin), say you add delivery cost it does not update the total price. for example on a dummy order created(before install)

 

sub-total :70.78

delivery :00.00

vat (17.5%):12.39

total :83.17

 

After I installed the edit order contribution:

 

sub-total :70.78

delivery :25.50

vat (17.5%):12.39

total :108.67

 

the VAT element did not change, it should read

 

sub-total :70.78

delivery :25.50

vat (17.5%):16.85

total :113.13

 

Doe anyone how to correct this.

Share this post


Link to post
Share on other sites

I am having the same problem. When I go into edit an order it says:

 

PHP Fatal error: Call to undefined function tep_field_exists() in D:\Web_Root\LocalUser\cidwoodworking\admincid3\edit_orders.php on line 127

 

Any help would greatly be appreciated. I use OSC 2.2 MS2

Share this post


Link to post
Share on other sites

I have version 1.75 installed.

 

I have register globals off. I have installed the code to fix this in edit_orders.php

 

My problem is with totals. I can select products and attributes and they display as an order item on the edit orders screen, but there is never any extended pricing. There are never any subtotals.

 

If I manually enter a subtotal it does not calculate the price. Or if I add shipping the shipping is not calculated in the price.

 

Any ideas?

Share this post


Link to post
Share on other sites
I have register globals off. I have installed the code to fix this in edit_orders.php

 

Is this a patch/contribution or did you do it yourself?


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.

Share this post


Link to post
Share on other sites

I have this contribution installed - Version 1.73 - Everything seemed to be working fine except all of a sudden 80 percent of my orders are missing the items in the order. The order total, shipping etc is still intact but the actual products are missing. I looked at the orders_products table and they are missing in there also - so it seems for some reason that I am not aware they are being deleted.

 

And there is no pattern that I can discern.

 

I see that Giirov -> http://forums.oscommerce.com/index.php?sho...c=54032&st=440#

had a similar issue and was wondering if his fix would solve mine? I am curious as to what prompted the records to be deleted since it seemed to be working fine and then all of a sudden they are all missing.

 

Please help!

Thanks

Jason

Share this post


Link to post
Share on other sites
I have this contribution installed - Version 1.73 - Everything seemed to be working fine except all of a sudden 80 percent of my orders are missing the items in the order. The order total, shipping etc is still intact but the actual products are missing. I looked at the orders_products table and they are missing in there also - so it seems for some reason that I am not aware they are being deleted.

 

And there is no pattern that I can discern.

 

I see that Giirov -> http://forums.oscommerce.com/index.php?sho...c=54032&st=440#

had a similar issue and was wondering if his fix would solve mine? I am curious as to what prompted the records to be deleted since it seemed to be working fine and then all of a sudden they are all missing.

 

Please help!

Thanks

Jason

 

I think I see what is happening. This is a bug that had already been identified and fixed by someone else, but didn't make it into my updates. My apologies.

 

At line 295 find

 

$Query = "delete from " . TABLE_ORDERS_PRODUCTS . " where orders_products_id = '$orders_products_id';";

 

and change it to:

 

$Query = "delete from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$oID . "' and orders_products_id = '$orders_products_id';";

 

and then at line 304 find

 

$Query = "delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_products_id = '$orders_products_id';";

 

and change it to:

 

$Query = "delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$oID . "' and orders_products_id = '$orders_products_id';";


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.

Share this post


Link to post
Share on other sites
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

 

Thanks to Giirov for this fix. Also I see why it hasn't been added to my updates- because there haven't been any. :)


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.

Share this post


Link to post
Share on other sites

Hi

 

I installed this contrib, and I think everthing went ok.

 

I still have some questions in regards to this contrib:

  • can I add new orders to an account, or do I need a to install new contrib for this
  • I had some customers that didn't return to the site after being redirected to pay by multipay, I received payment for these orders but they don't appear in their account. However I'm able to call it up with the order Id . Can I somehow with this tool fix it, so that the order appears in the customers account?

Denice

Share this post


Link to post
Share on other sites
Hi

 

I installed this contrib, and I think everthing went ok.

 

I still have some questions in regards to this contrib:

  • can I add new orders to an account, or do I need a to install new contrib for this
     
  • I had some customers that didn't return to the site after being redirected to pay by multipay, I received payment for these orders but they don't appear in their account. However I'm able to call it up with the order Id . Can I somehow with this tool fix it, so that the order appears in the customers account?

Denice

Share this post


Link to post
Share on other sites
Hi

 

I installed this contrib, and I think everthing went ok.

 

I still have some questions in regards to this contrib:

  • can I add new orders to an account, or do I need a to install new contrib for this
     
  • I had some customers that didn't return to the site after being redirected to pay by multipay, I received payment for these orders but they don't appear in their account. However I'm able to call it up with the order Id . Can I somehow with this tool fix it, so that the order appears in the customers account?

Denice

 

This contribution wasn't intended for adding new orders, only modifying existing ones. There is a contribution called manual order entry that will probably due the trick. Although if you implement the code necessary to accomplish what you're looking for in your second question, you could process the order through your own account or an account you set up for this purpose, then change the customer id associated with the order (you need to know the customer id for the person whom you would like to associate the order with)

 

Anyway, for your second question, you would need to modify the customer id associated with the order. To add in that functionality you would need to do something like this:

 

Don't forget- BACKUP!

 

(this code has not been tested)

 

at about line 165, find this code:

 

customers_telephone = '" . tep_db_input($update_customer_telephone) . "',

 

and add this in directly underneath it:

 

customers_id = '" . tep_db_input($_POST['update_customer_id']) . "',

 

then at about line 806 find this:

 

 <tr>
<td class="main"><b><?php echo ENTRY_CUSTOMER_COUNTRY; ?>: </b></td>
<td><span class="main"><input name="update_customer_country" size="25" value="<?php echo tep_html_quotes($order->customer['country']); ?>"></span></td>
<td> </td>
<td><span class="main"><input name="update_delivery_country" size="25" value="<?php echo tep_html_quotes($order->delivery['country']); ?>"></span></td>
<td> </td>
<td><span class="main"><input name="update_billing_country" size="25" value="<?php echo tep_html_quotes($order->billing['country']); ?>"></span></td>
 </tr>

 

and add this code directly beneath it:

 

 <tr>
<td class="main"><b>Customer ID: </b></td>
<td><span class="main"><input name="update_customer_id" size="25" value="<?php echo tep_html_quotes($order->customer['id']; ?>"></span></td>
<td> </td>
<td> </td>
 <td> </td>
<td> </td>
 </tr>

 

Test this out and see how it goes.

Edited by djmonkey1

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.

Share this post


Link to post
Share on other sites

Hi,

 

I tried to paste the code

 

<tr>

<td class="main"><b>Customer ID: </b></td>

<td><span class="main"><input name="update_customer_id" size="25" value="<?php echo tep_html_quotes($order->customer['id']; ?>"></span></td>

<td> </td>

<td> </td>

<td> </td>

<td> </td>

</tr>

 

but I receive this error:

 

Parse error: parse error, unexpected ';' in /home/jewelryt/public_html/admin/edit_orders.php on line 821

 

This is the part of the code the error is pointing to:

 

</tr>

<tr>

<td class="main"><b>Customer ID: </b></td>

<td><span class="main"><input name="update_customer_id" size="25" value="<?php echo tep_html_quotes($order->customer['id']; ?>"></span></td>

<td> </td>

<td> </td>

<td> </td>

<td> </td>

</tr>

<tr>

<td class="main"><b><?php echo ENTRY_CUSTOMER_PHONE; ?>: </b></td>

 

Did I paste it incorrect?

 

Denice

Edited by jewelrytrends

Share this post


Link to post
Share on other sites
Hi,

 

I tried to paste the code

 

but I receive this error:

 

This is the part of the code the error is pointing to:

 

Did I paste it incorrect?

 

Denice

 

Sorry, I missed a ")".

 

That line should be

 

<td><span class="main"><input name="update_customer_id" size="25" value="<?php echo tep_html_quotes($order->customer['id']); ?>"></span></td>

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.

Share this post


Link to post
Share on other sites
Sorry, I missed a ")".

 

That line should be

That fixed the error, however when I try to edit and I click the update button I receive this error

 

Warning: Invalid argument supplied for foreach() in /home/jewelryt/public_html/admin/edit_orders.php on line 270

 

Warning: Invalid argument supplied for foreach() in /home/jewelryt/public_html/admin/edit_orders.php on line 340

 

Warning: Invalid argument supplied for foreach() in /home/jewelryt/public_html/admin/edit_orders.php on line 361

 

Warning: Invalid argument supplied for foreach() in /home/jewelryt/public_html/admin/edit_orders.php on line 371

 

Warning: Cannot modify header information - headers already sent by (output started at /home/jewelryt/public_html/admin/edit_orders.php:270) in /home/jewelryt/public_html/admin/includes/functions/general.php on line 31

Share this post


Link to post
Share on other sites
That fixed the error, however when I try to edit and I click the update button I receive this error

 

Interesting. I'm currently getting the exact same errors on a new version of Order Editor that I'm working on.

 

For that first line that was added in, try this instead:

 

customers_id = '" . tep_db_input($update_customer_id) . "',

 

If that works, please let me know. It will be useful information for me.

Edited by djmonkey1

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.

Share this post


Link to post
Share on other sites
Interesting. I'm currently getting the exact same errors on a new version of Order Editor that I'm working on.

 

For that first line that was added in, try this instead:

 

customers_id = '" . tep_db_input($update_customer_id) . "',

 

If that works, please let me know. It will be useful information for me.

I changed the code as you suggested, however I still get the same error. When I hit the back button, it tells me that it was updated, but when I look in at the orders it isn't under orders or when I click to see the orders under the customers option is is not there also.

 

Denice

Share this post


Link to post
Share on other sites
I changed the code as you suggested, however I still get the same error. When I hit the back button, it tells me that it was updated, but when I look in at the orders it isn't under orders or when I click to see the orders under the customers option is is not there also.

 

Denice

 

Yes, I get the same thing with my development file. But, my development file is heavily modified and I was expecting to run into errors I wouldn't be able to explain very easily. :)

 

Hmmmm......

 

Revert the file to however it was before we started and test it again.


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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×