Jump to content
jhilgeman

NEW! Complete Order Editing Tool!

Recommended Posts

Hi

 

i love the order edit tool. But since i updated my shop after 1 1/2 years to the newest official osc version the order edit tool has got problems with the _two_ taxes in the store. When i edit an order with the tool and there are items with both tax classes both taxes have the same total.

 

I hope i explained the bug as good as someone can find the bug. I had a look at the code but didn't find the right place to hack around.

 

cheers,

axel

Share this post


Link to post
Share on other sites

Hi

 

Great contrib, good job.

 

I added in a cvv2 field to my orders so I need this to be within the edit field.

 

So far I have made the following two edits, however, when I change the cvv2 code amd click update, nothing happens:

 

within catalog/admin/includes/languages/english/edit_orders.php, added:

define('ENTRY_CREDIT_CARD_CVV2', 'CVV2:');

 

within catalog/admin/edit_orders.php, added:

<tr>

<td class="main"><?php echo ENTRY_CREDIT_CARD_CVV2; ?></td>

<td class="main"><input name="update_info_cc_cvv2" size="3" value="<?php echo $order->info['cc_cvv2']; ?>" /></td>

</tr>

after ENTRY_CREDIT_CARD_NUMBER and before ENTRY_CREDIT_CARD_EXPIRES (around line 840).

 

Can you advise what I am missing, got a feeling its around

 

$UpdateOrders .= "cc_expires = '" . $_POST['update_info_cc_expires'] . "',

 

Many thanks

 

W

Edited by Wired PSF

Share this post


Link to post
Share on other sites

Hi

 

Just noticed...

 

If you amend an order that has attributes, ie add more of the same stock and update, it updates the total product stock quantity but when you view the attributes, this is unchanged. I am using this with Attributes Sets Plus and QTPro.

 

Sorry, dont know how to fix but happy to work with someone that can...

 

W

Share this post


Link to post
Share on other sites
Hi

 

Great contrib, good job.

 

I added in a cvv2 field to my orders so I need this to be within the edit field.

 

So far I have made the following two edits, however, when I change the cvv2 code amd click update, nothing happens:

 

within catalog/admin/includes/languages/english/edit_orders.php, added:

define('ENTRY_CREDIT_CARD_CVV2', 'CVV2:');

 

within catalog/admin/edit_orders.php, added:

<tr>

<td class="main"><?php echo ENTRY_CREDIT_CARD_CVV2; ?></td>

<td class="main"><input name="update_info_cc_cvv2" size="3" value="<?php echo $order->info['cc_cvv2']; ?>" /></td>

</tr>

after ENTRY_CREDIT_CARD_NUMBER and before ENTRY_CREDIT_CARD_EXPIRES (around line 840).

 

Can you advise what I am missing, got a feeling its around

 

$UpdateOrders .= "cc_expires = '" . $_POST['update_info_cc_expires'] . "',

 

Many thanks

 

W

 

After the line

 

cc_type = '" . tep_db_input($_POST['update_info_cc_type']) . "',

 

add this line:

 

cc_cvv2 = '" . tep_db_input($_POST['update_info_cc_cvv2']) . "',


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 love the order edit tool. But since i updated my shop after 1 1/2 years to the newest official osc version the order edit tool has got problems with the _two_ taxes in the store. When i edit an order with the tool and there are items with both tax classes both taxes have the same total.

 

I hope i explained the bug as good as someone can find the bug. I had a look at the code but didn't find the right place to hack around.

 

cheers,

axel

 

Did you use an older version of Order Editor with your old shop that didn't have this problem?


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

 

Just noticed...

 

If you amend an order that has attributes, ie add more of the same stock and update, it updates the total product stock quantity but when you view the attributes, this is unchanged. I am using this with Attributes Sets Plus and QTPro.

 

Sorry, dont know how to fix but happy to work with someone that can...

 

W

 

I don't understand the problem.


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

Thanks djmonkey, the cvv2 works a treat. For info, why did it go there and not somwhere below (ie where the card number and expiry date are? Are these sense checked fields by osc and cvv2 is not?

 

Re the query about not updating stock figures in attributes, looking at the db files, the Table: products is the one that does update, Table: products_stock is the one that does not.

 

I'll try and compare what happens when a regular order is made (which updates products_stock) and see if I can figure out what to change in the edit order.

 

Nice.

 

W

 

Hi

 

Just noticed...

 

If you amend an order that has attributes, ie add more of the same stock and update, it updates the total product stock quantity but when you view the attributes, this is unchanged. I am using this with Attributes Sets Plus and QTPro.

 

Sorry, dont know how to fix but happy to work with someone that can...

 

W

Share this post


Link to post
Share on other sites
Thanks djmonkey, the cvv2 works a treat. For info, why did it go there and not somwhere below (ie where the card number and expiry date are? Are these sense checked fields by osc and cvv2 is not?

 

Re the query about not updating stock figures in attributes, looking at the db files, the Table: products is the one that does update, Table: products_stock is the one that does not.

 

I'll try and compare what happens when a regular order is made (which updates products_stock) and see if I can figure out what to change in the edit order.

 

Nice.

 

W

 

The db update fields for cc info were a little weird, and until you asked your question I hadn't paid them much attention. I've re-written that particular area to look like this for future releases:

 

payment_method = '" . tep_db_input($_POST['update_info_payment_method']) . "',
		cc_type = '" . tep_db_input($_POST['update_info_cc_type']) . "',
		cc_owner = '" . tep_db_input($_POST['update_info_cc_owner']) . "',
		cc_number = '" . tep_db_input($_POST['update_info_cc_number']) . "',
		cc_expires = '" . tep_db_input($_POST['update_info_cc_expires']) . "',
		orders_status = '" . tep_db_input($_POST['status']) . "'";

	$UpdateOrders .= " where orders_id = '" . tep_db_input($_GET['oID']) . "';";

 

For your stock updating issue, products_stock is a custom table that was added in, most likely, by one of the contributions you mentioned. You would need to add a new query for this after

 

tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity - " . $_POST['add_product_quantity'] . ", products_ordered = products_ordered + " . $_POST['add_product_quantity'] . " where products_id = '" . $_POST['add_product_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

Edited

 

Sorry, ignore, does not work

 

Thanks

 

Added in the following which seems to work:

 

tep_db_query("update " . TABLE_PRODUCTS_STOCK . " set products_stock_quantity = products_stock_quantity - " . $_POST['add_product_stock_quantity'] . ", products_ordered = products_ordered + " . $_POST['add_product_stock_quantity'] . " where products_id = '" . $_POST['add_product_products_id'] . "'");

 

For your stock updating issue, products_stock is a custom table that was added in, most likely, by one of the contributions you mentioned. You would need to add a new query for this after

 

tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity - " . $_POST['add_product_quantity'] . ", products_ordered = products_ordered + " . $_POST['add_product_quantity'] . " where products_id = '" . $_POST['add_product_products_id'] . "'");

Edited by Wired PSF

Share this post


Link to post
Share on other sites

Hi,

 

I've just added this contrib to my shop

http://www.oscommerce.com/community/contri...all/search,cvv2

called cvv2 for entire order.

 

Unfortunately it doesn't do any kind of checks on the cvv number and you can even leave it blank when placing an order which is of course no use.

 

Does this contrib include a cvv2 part to it? If so, does it check the number has been input?

 

Also, i don't really know much about cvv numbers, should certain numbers be specific to certain cards? If so, does this contrib check that too?

 

Cheers

 

Daz

Share this post


Link to post
Share on other sites
Hi,

 

I've just added this contrib to my shop

http://www.oscommerce.com/community/contri...all/search,cvv2

called cvv2 for entire order.

 

Unfortunately it doesn't do any kind of checks on the cvv number and you can even leave it blank when placing an order which is of course no use.

 

Does this contrib include a cvv2 part to it? If so, does it check the number has been input?

 

Also, i don't really know much about cvv numbers, should certain numbers be specific to certain cards? If so, does this contrib check that too?

 

Cheers

 

Daz

 

Order Editor doesn't check anything, it simply allows the store admin to easily update and modify order information.

 

There is a discussion a few posts up about adding the CVV2 fields into Order Editor.


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

3/21/2006

v2.1

 

- Fixed error caused by extraneous character in admin/includes/languages/english/edit_orders.php (thanks to mrossi for first finding and correcting this)

- Thanks to banachek, added Spanish language translation

- Thanks to M@verick, added full (as of v2.0) French translation with button

- Updated language support for a number of additional languages (as found strewn throughout the contribution packages), although most need updated translations

- Fixed bug where product_id was not written to database when adding a product on sites where register_globals was turned off

- Fixed bug where syntax error was displayed when adding a product with a quote or quotes in the product name

- Added checkbox for deleting items and changed code so items can have quantities of zero and less than zero. This allows for negative quantity calculations, including negative tax, in case you want to issue a credit

- Changed the way tax on shipping is calculated, again, by adding two optional methods starting at line 292. The first method calculates the rate based on a tax class id of '1' and information stored in the admin configuration and order details. The second method is a hardcoded rate, activated by default and set at 0.00

- Modified stock subtraction function in the add product case so that it will only occur if "Subtract stock" is set to true in admin->configuration->stock

- Replaced instances of "edit_orders.php" in the file code with FILENAME_ORDERS_EDIT

- Updated stock check queries to adjust product stock and products ordered when editing product quantities in order information

- Revised code for updating cc info

- Various other minor modifications too numerous to remember


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
Edited

 

Sorry, ignore, does not work

 

Thanks

 

Added in the following which seems to work:

 

tep_db_query("update " . TABLE_PRODUCTS_STOCK . " set products_stock_quantity = products_stock_quantity - " . $_POST['add_product_stock_quantity'] . ", products_ordered = products_ordered + " . $_POST['add_product_stock_quantity'] . " where products_id = '" . $_POST['add_product_products_id'] . "'");

 

The variable

$_POST['add_product_stock_quantity']

doesn't exist in OE, unless you created it somewhere else. You should use

$_POST['add_product_quantity']

.

 

I might be able to help you more but I would need to know the structure of the table products_stock.

 

Also, if you want to upgrade to v2.1, I know that there are three stock checks in that version: one for changing product quantities, one for deleting products, and one for adding products. You would have to add on to all three.


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 haven't tried the Order Editor for a long time, as the last time I did there was a nasty bug. When you had a single (or maybe double) quote in a product name it ended up trashing all of the product names in the database.

 

Has this bug been fixed? I had a look through the release notes and couldn't see anything.

 

Does anyone have a test system they could try it out on?

 

Thanks,

 

Jon.

Share this post


Link to post
Share on other sites
I haven't tried the Order Editor for a long time, as the last time I did there was a nasty bug. When you had a single (or maybe double) quote in a product name it ended up trashing all of the product names in the database.

 

Has this bug been fixed? I had a look through the release notes and couldn't see anything.

 

Does anyone have a test system they could try it out on?

 

Thanks,

 

Jon.

 

The only problem I've seen with quotes in a product name is a MySQL syntax error when adding a product with a quote in the name. That's been fixed as of v2.1. I've tested the most recent versions (2.0 and 2.1) extensively and have had no major problems.


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 installed the order editor mod without any problems.

 

But its calculating the tax incorrectly (for me). I don't use sub totals and its calculating a seperate tax value and deducting it from the total. I've had a quick look at the code and I'm confident I'll be able to alter it to suit my needs.

 

However, maybe I'm being stupid but wouldn't it make sense to calculate all of the order_totals values through the order_total class rather than hard coding it all? That way, it would work perfectly for everyone - provided it calculates everything correctly when the customer places the order.

 

It should be possible to use the order_total class to generate the correct values and then just alter them. I wouldn't of thought this would be that difficult, though it would probably take me a while to make the changes.

 

Is there a good reason why it wasn't coded in this way?

 

Jon.

Share this post


Link to post
Share on other sites
I installed the order editor mod without any problems.

 

But its calculating the tax incorrectly (for me). I don't use sub totals and its calculating a seperate tax value and deducting it from the total. I've had a quick look at the code and I'm confident I'll be able to alter it to suit my needs.

 

However, maybe I'm being stupid but wouldn't it make sense to calculate all of the order_totals values through the order_total class rather than hard coding it all? That way, it would work perfectly for everyone - provided it calculates everything correctly when the customer places the order.

 

It should be possible to use the order_total class to generate the correct values and then just alter them. I wouldn't of thought this would be that difficult, though it would probably take me a while to make the changes.

 

Is there a good reason why it wasn't coded in this way?

 

Jon.

 

Probably because the order_total class doesn't exist in the admin side in a stock osC install and the original author wanted the file to be stand-alone and easy to install.

 

You're right though. It's something I've thought about and discussed. For this contribution to work for everyone that's how it will have to be done, short of just writing the order_total class into the file.


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 guess the easiest thing is just to copy the order_total class in to admin, as part of the install.

 

One issue I can see is that sometimes you might want the standard order_totals records. Though it shouldn't be too difficult to add an override so that they aren't generated automatically.

 

I had a quick look at the code and it doesn't look like it will be too difficult to make the changes, more just a case of someone having the time to do it. I'll try and have a go over the weekend - I'll have to spend some time making changes for it to work for me so I might as well do this instead.

 

Jon.

Edited by jon_l

Share this post


Link to post
Share on other sites
I guess the easiest thing is just to copy the order_total class in to admin, as part of the install.

 

One issue I can see is that sometimes you might want the standard order_totals records. Though it shouldn't be too difficult to add an override so that they aren't generated automatically.

 

I had a quick look at the code and it doesn't look like it will be too difficult to make the changes, more just a case of someone having the time to do it. I'll try and have a go over the weekend - I'll have to spend some time making changes for it to work for me so I might as well do this instead.

 

Jon.

 

To do this, wouldn't you have to install all the order_total modules as well as their language definitions on the admin side as well?

 

Also, wouldn't you have to modify the order_total modules to work from the information submitted through the form rather than trying to calculate everything from scratch, especially in regards to tax?

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

Actually it shouldn't be necessary to copy any of the order_totals (or other) code from catalog as part of the install as you could just refer to it directly.

 

There won't be any need to change the order_totals modules or any of the code on the catalog side. All you have to do is setup all of the variables with the relevant information that existed just before the order was placed, ie before the order_totals were created.

 

It looks like the actual order_total modules themselves use variables setup by the order class, so it will be necessary to create the order class prior to calling the order_totals class / modules.

 

At least that is how I see it. I'm not PHP expert but logically all we need to do is run the part of the checkout process that creates all of these values in the first place. Does that make sense?

 

It would also be able to create the shipping values, but as some installs would have multiple shipping options it would be necessary to prompt for the correct shipping module to be selected. Though we'd also need to be able to offer an override, to manually change them.

 

So in effect there would be a 'automatically update order_totals and shipping' button and a 'manual update' button.

 

Jon.

Share this post


Link to post
Share on other sites
At least that is how I see it. I'm not PHP expert but logically all we need to do is run the part of the checkout process that creates all of these values in the first place. Does that make sense?

In a way, yes, but we don't want to run the checkout process over again per se, we want to total the order together in a very similar manner.

 

As far as I can tell, the actual calculations are done in catalog/includes/classes/order.php. Maybe we can just use that? There's not much in the order_total class or the order_total modules that I can see.


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

Actually, the place to start is with checkout_process as this is where all of the order related classes get created then called before being written to the database. If you look at this you should be able to work out the way it works.

 

I just had a look through it and it doesn't look like it will be too difficult, but it will take me a while to work it all out as I'm not that familiar with the code. The person who wrote checkout_process could probably do what we need very quickly.

 

Again, I'm not an expert so I wouldn't take any of my comments as gospel!

 

Jon.

Share this post


Link to post
Share on other sites
If they entered their postcode incorrectly.

 

If they want to add a product.

 

If they want to delete a product.

 

If there was a problem with calculation done for taxes, shipping, etc during the checkout process.

 

If you want to give them a discount.

 

etc., etc.

 

I understand fixing an issue, like postal code. but, if you want to add a product, how do they pay for it if they don't go through the checkout process?

 

If you want to give them a discount, they've already paid, haven't they?

 

I would think s

Share this post


Link to post
Share on other sites

I am having a problem with the payment option not working, when I enter the method of payment nothing happens? >_< Can anyone help?

Share this post


Link to post
Share on other sites

As stated in an earlier post there is a bug when a order uses 2 VAT-rates. When tis is the case there are 2 entries in orders_total of class "ot_tax" :

One has the title containing the name of VAT-rate 1

The other one has the title containing the name of the VAT-rate 2

 

When the order_edit module update's the ot_tax record, it updates BOTH records resulting in a "double" VAT calculation.

 

Futhermore I wonder why anyone would change a taxrate???,

This is completly defined in the taxzones, personaly i can imagine that disabling tax for a particulair artikel would make sence, but changing taxrates ???

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

×