Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

NEW! Complete Order Editing Tool!


jhilgeman

Recommended Posts

Actually while im here, is there any chance of setting the table size somewhere in edit_orders.php, its just a bind every time I upgrade to the latest version.

 

<table border="0" width="100%" cellspacing="0" cellpadding="2">

 

i have

 

<table border="0" width="95%" cellspacing="0" cellpadding="2">

so it doesnt go off the side of the screen.

 

 

Just a thought

Link to comment
Share on other sites

Hello - thanks for all the work done on this cobntribution .... but I have a problem - Installed 2.4 and it seemed OK but my customer reported a problem so I upgraded to 2.5 but the problem is still there. Problem is that edit_order.php does not display any subtotal or total in the Discount Shipping & Total section and if I update (even without making any change) the Discount Shipping & Total section displays two sets of zero boxes for shipping, subtotal & total - checked the db & sure enuff there are duplicate records in orders_total .... Also tried to increase an order from 1 item to 2 items - on the fly calc worked fine but no change to the table orders_products occurred on update.

 

I made a small edit to 2.5.1. version of edit_orders.php to include credit card start date and cvv number as these two fields are part of the credit card information on the system ... but everything else is 'out of the box'.

 

Help would be much appreciated ..

 

Keith Denby

Link to comment
Share on other sites

Hello - thanks for all the work done on this cobntribution .... but I have a problem - Installed 2.4 and it seemed OK but my customer reported a problem so I upgraded to 2.5 but the problem is still there. Problem is that edit_order.php does not display any subtotal or total in the Discount Shipping & Total section and if I update (even without making any change) the Discount Shipping & Total section displays two sets of zero boxes for shipping, subtotal & total - checked the db & sure enuff there are duplicate records in orders_total .... Also tried to increase an order from 1 item to 2 items - on the fly calc worked fine but no change to the table orders_products occurred on update.

 

I made a small edit to 2.5.1. version of edit_orders.php to include credit card start date and cvv number as these two fields are part of the credit card information on the system ... but everything else is 'out of the box'.

 

Help would be much appreciated ..

 

Keith Denby

 

Have you double checked all the changes to admin/includes/classes/order.php? I reccommend going over the install text a few times and also doing a compare and merge with the file included in the package if you have a program that can do that.

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

Have you double checked all the changes to admin/includes/classes/order.php? I reccommend going over the install text a few times and also doing a compare and merge with the file included in the package if you have a program that can do that.

 

:blink: Doh! - I had made the amendments correctly to /admin/includes/classes/order.php ... and then managed not to upload the changed file to the server, so thanks for the pointer on where to look - all's well now ... thanks again!

 

Keith

Link to comment
Share on other sites

Hi Group!

 

Running v2.5.1

 

The problem is that i'm also using Quantity Price Breaks Per Product (http://www.oscommerce.com/community/contributions,1242)

 

And if i have a produkt with a price break at fx. 6 products.. the price is not updated correctly if i edit a order including that produkt, setting it frm 5 to 6 products! It still uses the price as were it 5..

 

Anybody got that covered before!?

 

I know its most unlikely that it can do it on the fly, but at least when the order is updated!

Link to comment
Share on other sites

Great contribution... installed it and it works great.

 

I don't know how I lived without it.

 

Is there a way that someone can ADD an order to a customer's account? We have an issue with orders paying through PayPal don't get logged and I'd like to place their order manually in the system.

 

I know there's a "manual order" contribution, but thought that since this is 90% there, it might be easy to add an order...

 

Thanks.

Link to comment
Share on other sites

Install the contribution today. Seems to be working about 95%, however when I go to the edit page I am seeing all variable names and not the variable values. Not sure why.

 

for example:

ENTRY_CUSTOMER_COMPANY:

ENTRY_CUSTOMER_NAME:

ENTRY_ADDRESS:

ENTRY_CUSTOMER_SUBURB:

ENTRY_CUSTOMER_CITY:

ENTRY_CUSTOMER_STATE:

ENTRY_CUSTOMER_POSTCODE:

ENTRY_CUSTOMER_COUNTRY:

ENTRY_CUSTOMER_PHONE:

ENTRY_CUSTOMER_EMAIL:

 

I think that I am missing something or the edit page is not finding where these variables are defined.

 

contrib.gif

Link to comment
Share on other sites

Install the contribution today. Seems to be working about 95%, however when I go to the edit page I am seeing all variable names and not the variable values. Not sure why.

 

for example:

ENTRY_CUSTOMER_COMPANY:

ENTRY_CUSTOMER_NAME:

ENTRY_ADDRESS:

ENTRY_CUSTOMER_SUBURB:

ENTRY_CUSTOMER_CITY:

ENTRY_CUSTOMER_STATE:

ENTRY_CUSTOMER_POSTCODE:

ENTRY_CUSTOMER_COUNTRY:

ENTRY_CUSTOMER_PHONE:

ENTRY_CUSTOMER_EMAIL:

 

I think that I am missing something or the edit page is not finding where these variables are defined.

Link to comment
Share on other sites

Install the contribution today. Seems to be working about 95%, however when I go to the edit page I am seeing all variable names and not the variable values. Not sure why.

 

for example:

ENTRY_CUSTOMER_COMPANY:

ENTRY_CUSTOMER_NAME:

ENTRY_ADDRESS:

ENTRY_CUSTOMER_SUBURB:

ENTRY_CUSTOMER_CITY:

ENTRY_CUSTOMER_STATE:

ENTRY_CUSTOMER_POSTCODE:

ENTRY_CUSTOMER_COUNTRY:

ENTRY_CUSTOMER_PHONE:

ENTRY_CUSTOMER_EMAIL:

 

I think that I am missing something or the edit page is not finding where these variables are defined.

Link to comment
Share on other sites

Hello,

 

I have been using the order editor and ran into the bug. I have been looking through this discussion and have yet to find the answer.

 

What we want is for the discount coupon to apply to the subtotal and then have the tax be calculated on the discounted subtotal.

 

I know this would be an issue because after looking at how tax is tracked at the item per item level rather then at the subtotal level this would be an issue.

 

So i tried to parse out the code that would allow me to just do discount * tax percent - subtotal to get the right subtotal that we need but couldn't figure out where you were calculating the discount into the order total.

 

Since we use the same tax percent for all the items there won't be an issue finding which tax percent to use but I just need to know where you guys evalute the "ot-coupon" class so that I can adjust the running total to this new amount.

 

Thanks in advance.

Link to comment
Share on other sites

Great contribution... installed it and it works great.

 

I don't know how I lived without it.

 

Is there a way that someone can ADD an order to a customer's account? We have an issue with orders paying through PayPal don't get logged and I'd like to place their order manually in the system.

 

I know there's a "manual order" contribution, but thought that since this is 90% there, it might be easy to add an order...

 

Thanks.

 

I would recommend one of the various manual order entry contributions that exist. To my mind, editing existing orders and creating new ones are two separate tasks.

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

Install the contribution today. Seems to be working about 95%, however when I go to the edit page I am seeing all variable names and not the variable values. Not sure why.

 

for example:

ENTRY_CUSTOMER_COMPANY:

ENTRY_CUSTOMER_NAME:

ENTRY_ADDRESS:

ENTRY_CUSTOMER_SUBURB:

ENTRY_CUSTOMER_CITY:

ENTRY_CUSTOMER_STATE:

ENTRY_CUSTOMER_POSTCODE:

ENTRY_CUSTOMER_COUNTRY:

ENTRY_CUSTOMER_PHONE:

ENTRY_CUSTOMER_EMAIL:

 

I think that I am missing something or the edit page is not finding where these variables are defined.

 

The language definition file is admin/includes/languages/english/edit_orders.php

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

I would recommend one of the various manual order entry contributions that exist. To my mind, editing existing orders and creating new ones are two separate tasks.

 

I found a contribution where you can setup a master password and then login into the customer's account and enter the order details.

Link to comment
Share on other sites

Hello,

 

I have been using the order editor and ran into the bug. I have been looking through this discussion and have yet to find the answer.

 

What we want is for the discount coupon to apply to the subtotal and then have the tax be calculated on the discounted subtotal.

 

I know this would be an issue because after looking at how tax is tracked at the item per item level rather then at the subtotal level this would be an issue.

 

So i tried to parse out the code that would allow me to just do discount * tax percent - subtotal to get the right subtotal that we need but couldn't figure out where you were calculating the discount into the order total.

 

Since we use the same tax percent for all the items there won't be an issue finding which tax percent to use but I just need to know where you guys evalute the "ot-coupon" class so that I can adjust the running total to this new amount.

 

Thanks in advance.

 

It's not a bug, it's the way the file is written. "ot_coupon" is not a core osCommerce order total class and so it is not included within the core of this contribution. The order total classes that are included with osCommerce are ot_total, ot_subtotal, ot_tax, ot_shipping, and ot_loworderfee. Order Editor introduces ot_custom and so supports that as well.

 

However, it is not at all difficult to add custom order total components to the tax total. Simply find this section of code:

 

// 1.4.0.1 Shipping Tax

		if (is_array ($_POST['update_totals'])){
		foreach($_POST['update_totals'] as $total_index => $total_details)
		{
			extract($total_details,EXTR_PREFIX_ALL,"ot");
			if($ot_class == "ot_shipping")//a good place to add in custom total components
			{
				if (DISPLAY_PRICE_WITH_TAX == 'true') {//the shipping charge includes tax
		$RunningTax[$default_tax_name] += ($ot_value * $_POST['update_shipping_tax']) / ($_POST['update_shipping_tax'] + 100);
				} else { //shipping tax is in addition to the shipping charge
$RunningTax[$default_tax_name] += (($_POST['update_shipping_tax'] / 100) * $ot_value);
				}
			}
		  }
		}

 

and change the line that reads

if($ot_class == "ot_shipping")//a good place to add in custom total components

to read

if (($ot_class == "ot_shipping") || ($ot_class == "ot_coupon"))//a good place to add in custom total components

 

 

Then find this section:

//just adding in shipping tax, don't mind me
	$ot_shipping_query = tep_db_query("
	SELECT class, value 
	FROM " . TABLE_ORDERS_TOTAL . " 
	WHERE orders_id = '" . (int)$oID . "'");
	$ot_shipping_value = tep_db_fetch_array($ot_shipping_query);


if ($ot_shipping_value['class'] == 'ot_shipping')//a good place to add in other fields to tax
	{
	if (DISPLAY_PRICE_WITH_TAX == 'true') {
		$RunningTax[$default_tax_name] += ($ot_shipping_value['value'] * $order->info['shipping_tax'] / ($order->info['shipping_tax'] + 100));
			} else {
		$RunningTax[$default_tax_name] += (($order->info['shipping_tax'] / 100) * $ot_shipping_value['value']);

				}// end if (DISPLAY_PRICE_WITH_TAX == 'true') {
				}// end if ($ot_shipping_value['class'] == 'ot_shipping')

	// end shipping tax calcs

 

and change it to

//just adding in shipping tax, don't mind me
	$ot_shipping_query = tep_db_query("
	SELECT class, value 
	FROM " . TABLE_ORDERS_TOTAL . " 
	WHERE orders_id = '" . (int)$oID . "'");
	$ot_shipping_value = tep_db_fetch_array($ot_shipping_query);


if (($ot_shipping_value['class'] == 'ot_shipping') ||  ($ot_shipping_value['class'] == 'ot_coupon''))//a good place to add in  other fields to tax
	{
	if (DISPLAY_PRICE_WITH_TAX == 'true') {
		 $RunningTax[$default_tax_name] += ($ot_shipping_value['value']  * $order->info['shipping_tax'] / ($order->info['shipping_tax'] +  100));
			} else {
		$RunningTax[$default_tax_name] += (($order->info['shipping_tax'] / 100) * $ot_shipping_value['value']);

				}// end if (DISPLAY_PRICE_WITH_TAX == 'true') {
				}// end if ($ot_shipping_value['class'] == 'ot_shipping')
 if ($ot_shipping_value['class'] == 'ot_coupon') {
 $RunningSubTotal += $ot_shipping_value['value'];
}

	// end shipping tax calcs

(this step also covers adding the coupon to the subtotal for the add a product case)

 

This can be done for any number of custom order total classes in this fashion.

 

In order to add the coupon to the subtotal, find this section of code:

if ($ot_class == "ot_tax") {

				if (DISPLAY_PRICE_WITH_TAX != 'true') { 
				//we don't add tax to the total here because it's already added to the subtotal
					$RunningTotal += $ot_value;
					}
					} else {
					$RunningTotal += $ot_value;
					}

and change it to

if ($ot_class == "ot_coupon") {
$RunningSubTotal += $ot_value; 
}
elseif ($ot_class == "ot_tax") {

				if (DISPLAY_PRICE_WITH_TAX != 'true') { 
				//we don't add tax to the total here because it's already added to the subtotal
					$RunningTotal += $ot_value;
					}
					} else {
					$RunningTotal += $ot_value;
					}

 

Finally, find this code:

// 2.2.2.3 Total
		if (DISPLAY_PRICE_WITH_TAX == 'true') {
		$Query = 'SELECT sum(value) 
		AS total_value from ' . TABLE_ORDERS_TOTAL . '
		WHERE class != "ot_total" 
		AND class != "ot_tax" 
		AND orders_id= "' . (int)$oID . '"';
		$result = tep_db_query($Query);
		$row = tep_db_fetch_array($result);
		$Total = $row['total_value'];
		} else {
		$Query = 'SELECT sum(value) 
		AS total_value from ' . TABLE_ORDERS_TOTAL . '
		WHERE class != "ot_total" 
		AND orders_id= "' . (int)$oID . '"';
		$result = tep_db_query($Query);
		$row = tep_db_fetch_array($result);
		$Total = $row['total_value'];
		}

and change it to

// 2.2.2.3 Total
		if (DISPLAY_PRICE_WITH_TAX == 'true') {
		$Query = 'SELECT sum(value) 
		AS total_value from ' . TABLE_ORDERS_TOTAL . '
		WHERE class != "ot_total" 
		AND class != "ot_tax" 
		AND class != "ot_coupon" 
		AND orders_id= "' . (int)$oID . '"';
		$result = tep_db_query($Query);
		$row = tep_db_fetch_array($result);
		$Total = $row['total_value'];
		} else {
		$Query = 'SELECT sum(value) 
		AS total_value from ' . TABLE_ORDERS_TOTAL . '
		WHERE class != "ot_total" 
		AND class != "ot_coupon" 
		AND orders_id= "' . (int)$oID . '"';
		$result = tep_db_query($Query);
		$row = tep_db_fetch_array($result);
		$Total = $row['total_value'];
		}

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

Also, where would we adjust the javascript to reflect these changes?

 

Find

if (action == 'subtotal') {
 <?php if (DISPLAY_PRICE_WITH_TAX == 'true') { ?>
 if(pid == 'p-total_incl')// display price with tax => total including tax
 <?php } else { ?>
 if(pid == 'p-total_excl')// display price without tax => total excluding tax
 <?php } ?>
 {
 sum+=Number(el[i].value);
 }
 }

 

and change it to

if (action == 'subtotal') {
 <?php if (DISPLAY_PRICE_WITH_TAX == 'true') { ?>
 if ((pid == 'p-total_incl') || (pid == 'ot_coupon'))// display price with tax => total including tax
 <?php } else { ?>
 if((pid == 'p-total_excl') || (pid == 'ot_coupon'))// display price without tax => total excluding tax
 <?php } ?>
 {
 sum+=Number(el[i].value);
 }
 }

 

Then find

if (action =='total'){
//I cheat here- the grand total always includes the value of the various totals including tax of 
//each item, regardless of individual shop settings.  So I take the various Total incls, all the
//ot_customs, ot_loworderfees, and any ot_shipping value, and voila
if ((pid ==  'ot_custom') || (pid == defaultTaxName + 'ot_shipping') || (pid == 'p-total_incl') || (pid == 'ot_loworderfee')) {
sum += Number(el[i].value);
 }

 

and change it to

if (action =='total'){
//I cheat here- the grand total always includes the value of the various totals including tax of 
//each item, regardless of individual shop settings.  So I take the various Total incls, all the
//ot_customs, ot_loworderfees, and any ot_shipping value, and voila
if ((pid ==  'ot_custom') || (pid == defaultTaxName + 'ot_shipping') || (pid == 'p-total_incl') || (pid == 'ot_loworderfee') || (pid == 'ot_coupon')) {
sum += Number(el[i].value);
 }

 

Let me know how this goes. You may need additional custom code to get the tax totals right.

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

This contribution is very appreciated and works well. First screen of edited order shows all like expected, after updating, total amount almost is almost doubled.

orders_total in db before updating:

value		  class			 order
1.72		   ot_shipping	1
6.03		   ot_netto		 2
0,9268		 ot_tax		   3
7			  ot_total		  4

after updating:

value		  class			 order
1.72		   ot_shipping	1
6.03		   ot_netto		 2
0,9268		 ot_tax		   3
12,7499		 ot_total		  4

 

It seems that all values before the total amount are added.

ot_netto is the amount incl. shipping, without tax.

Link to comment
Share on other sites

This contribution is very appreciated and works well. First screen of edited order shows all like expected, after updating, total amount almost is almost doubled.

orders_total in db before updating:

value		  class			 order
1.72		   ot_shipping	1
6.03		   ot_netto		 2
0,9268		 ot_tax		   3
7			  ot_total		  4

after updating:

value		  class			 order
1.72		   ot_shipping	1
6.03		   ot_netto		 2
0,9268		 ot_tax		   3
12,7499		 ot_total		  4

 

It seems that all values before the total amount are added.

ot_netto is the amount incl. shipping, without tax.

 

ot_netto is basically the subtotal then?

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.

Link to comment
Share on other sites

ot_netto is basically the subtotal then?

Hi djmonkey1!

 

i actual don't use subtotal (as amount of goods without shipping) in my shop, but i could use it. Essential for me is ot_netto as total amount of goods without tax, incl. shipping costs, it must be shown at the invoice.

Also shipping costs in invoice are individually shown without tax. Edit_orders don't add tax to shipping costs.

My shop shows prices with taxes.

This problem have many shops in europe, because this invoice layout is mandatory.

Link to comment
Share on other sites

Hi djmonkey1!

 

i actual don't use subtotal (as amount of goods without shipping) in my shop, but i could use it. Essential for me is ot_netto as total amount of goods without tax, incl. shipping costs, it must be shown at the invoice.

Also shipping costs in invoice are individually shown without tax. Edit_orders don't add tax to shipping costs.

My shop shows prices with taxes.

This problem have many shops in europe, because this invoice layout is mandatory.

 

The first thing you should do is a find and replace on your edit_orders.php file. Find every instance of "ot_subtotal" and replace it with "ot_netto".

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

The first thing you should do is a find and replace on your edit_orders.php file. Find every instance of "ot_subtotal" and replace it with "ot_netto".

 

Hi djmonkey1,

 

Yep, this solved the main problem! Great!

What can i do now to have shipping costs calculated with taxes? Maybe change $sort_order?

Link to comment
Share on other sites

Hi Guys,

 

I don't really know much about OS Commerce modifications. i just uploaded all the files and now have the update option. however once i try to update something i get the following error:

 

1054 - Unknown column 'shipping_tax' in 'field list'

 

[deleted]

 

[TEP STOP]

 

 

 

how can i change this tax problem?

 

thanks for the help and especially the contribution!!!!

 

ps. Next time you report an error please make sure you do not have personal data with it !

Edited by wheeloftime
Link to comment
Share on other sites

Hi Guys,

 

I don't really know much about OS Commerce modifications. i just uploaded all the files and now have the update option. however once i try to update something i get the following error:

 

1054 - Unknown column 'shipping_tax' in 'field list'

 

UPDATE orders SET where orders_id = '19';

 

[TEP STOP]

 

 

 

how can i change this tax problem?

 

thanks for the help and especially the contribution!!!!

-------------

STEP0

-------------

 

Run the following command on your MySQL database (if you always or almost always charge tax on shipping, you may want to enter a different default value for shipping_tax, ie 16.0000 instead of 0.0000):

 

ALTER TABLE orders ADD shipping_tax DECIMAL( 7, 4 ) DEFAULT '0.000' NOT NULL ;

INSERT into configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) values ('', 'Order Editor- Display Payment Method dropdown?', 'DISPLAY_PAYMENT_METHOD_DROPDOWN', 'true', 'Display Payment Method in Order Editor as dropdown menu (true) or as input field (false)', '1', '21', NULL, '2006-04-02 11:51:01', NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),');

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.

Link to comment
Share on other sites

Hi djmonkey1,

 

Yep, this solved the main problem! Great!

What can i do now to have shipping costs calculated with taxes? Maybe change $sort_order?

 

There is a field for shipping tax, it's located on the edit orders page in Section 4 Discount, Shipping and Total.

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...