Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

jhilgeman

NEW! Complete Order Editing Tool!

Recommended Posts

By the way, is there a way to add a completely new order? Or is there another contribution to do it?

By the sounds of it this is what you are looking for CLICK HERE

 

It is Step by Step Manual Order Entry and allows you to create new accounts and make new orders from admin. BEWARE though, it is very buggy contribution and a hell of an install!

Edited by chooch

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Share this post


Link to post
Share on other sites
I've loaded the latest order editing tool, however when I try to edit an order I get the following error

Parse error: parse error, unexpected $end in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\shop\admin\edit_orders.php on line 2307

 

Has anyone found the open bracket?

 

I've tried all the edit_orders.php files from all the contributions 2.8 and above

 

(I can get the non-AJAX version 2.7.4 working just fine)

Does the 'C' not indicate that it is searching for the command on your PC? Looks like you are using a server software on your PC rather than uploading files to a real sever.


Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Share this post


Link to post
Share on other sites
Does the 'C' not indicate that it is searching for the command on your PC? Looks like you are using a server software on your PC rather than uploading files to a real sever.

 

Hi Chooch,

 

I AM running this on my staging server which is indeed a local Windows Apache Server, I don't see how this would be my issue?

Share this post


Link to post
Share on other sites

I'm a Canadian store which has USD as the default currency, so when I enter shipping quotes on Canadian orders, I have have to enter a Canadian dollar amount from the shipping company.

 

Basically, I just want the product prices converted to the different currency, and then everything else would be saved into the database exactly as I typed, without converting. So a shipping price of $195 will not get converted into $220. It should be saved exactly as $195.

 

Is that possible?

 

What lines of code should I be looking at editing?

 

Hope you can help!

Share this post


Link to post
Share on other sites
Hi Chooch,

 

I AM running this on my staging server which is indeed a local Windows Apache Server, I don't see how this would be my issue?

Maybe the best way to clear it up would be to use a real server?


Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Share this post


Link to post
Share on other sites
Maybe the best way to clear it up would be to use a real server?

 

My server is not the problem, I have developed 3 oscommerce sites on this same server.

 

Any help for the real issue would be appreciated.

Share this post


Link to post
Share on other sites
My server is not the problem, I have developed 3 oscommerce sites on this same server.

 

Any help for the real issue would be appreciated.

what code do you have on this line:

shop\admin\edit_orders.php on line 2307


Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Share this post


Link to post
Share on other sites
Hi,

 

I've added an additional drop-down block for Purchase Order payment method but can't figure out the trick with hidding the drop-down fields when not selected. They are always visible doesn't matter what payment method is selected. Does anybody have any idea on how to achieve that?

 

Thanks in advance.

Can anybody advise on my post above? Any help would be appreciated.

Share this post


Link to post
Share on other sites
what code do you have on this line:

shop\admin\edit_orders.php on line 2307

 

I had to go live, so I backed out and am using the non-AJAX version. I will have to revisit this at a later date.

Share this post


Link to post
Share on other sites

Hi,

 

I installed the latest version of the contrib and it's working fine - except for one thing:

Upon editing, it deletes the customer adress fields.

The shipping and billing adress fields work fine (I can edit them and update them), but the customer adress fields are always being deleted.

I cannot enter anything and save it there... they stay empty.

 

Any ideas what could cause that?

Share this post


Link to post
Share on other sites

EvilDragon .. I thought I was crazy and the only one with that problem. LOL

 

I have spent days and days trying to figure it out .. but no luck.

 

Everything else works great .. but whenever I click update all the customers address details are deleted from the orders tables.

 

Now I have a Edit Comments Mod installed that allows you to edit the order comments. When I take out the code ... the problem goes away.

 

But I really like the edit comments capabililty and have it in my heavily modified orders.php and custom shipping.php file

 

Are you using the edit comments mod too?

Edited by insomniac2

Share this post


Link to post
Share on other sites
EvilDragon .. I thought I was crazy and the only one with that problem. LOL

 

I have spent days and days trying to figure it out .. but no luck.

 

Everything else works great .. but whenever I click update all the customers address details are deleted from the orders tables.

 

Now I have a Edit Comments Mod installed that allows you to edit the order comments. When I take out the code ... the problem goes away.

 

But I really like the edit comments capabililty and have it in my heavily modified orders.php and custom shipping.php file

 

Are you using the edit comments mod too?

 

Hm, no, that's weird, I don't have that mod installed.

I think it has something to do with the REGISTER_GLOBALS set to off.

 

I used edit_invoice.php earlier with the exact same problem an did a modification (can be downloaded here), but I'm no coder and it took a while for me to figure out what to check (first, READ OUT each field from the database...). It looks like you need to find out whether the server is in POST mode or not and then include the database fields.

The new script seems too complicated for me to find out such thing, but it might be the reason.

 

What's weird is that it's only the customer details...

Share this post


Link to post
Share on other sites

Alrighty ... if your customer's main address is disappearing in the edit_order.php, try this:

  • FILE: edit_orders.php

FIND: around line 74

// 1.1 UPDATE ORDER INFO #####

		$UpdateOrders = "update " . TABLE_ORDERS . " set 
	customers_name = '" . tep_db_input(stripslashes($update_customer_name)) . "',
	customers_company = '" . tep_db_input(stripslashes($update_customer_company)) . "',
	customers_street_address = '" . tep_db_input(stripslashes($update_customer_street_address)) . "',
	customers_suburb = '" . tep_db_input(stripslashes($update_customer_suburb)) . "',
	customers_city = '" . tep_db_input(stripslashes($update_customer_city)) . "',
	customers_state = '" . tep_db_input(stripslashes($update_customer_state)) . "',
	customers_postcode = '" . tep_db_input($update_customer_postcode) . "',
	customers_country = '" . tep_db_input(stripslashes($update_customer_country)) . "',
	customers_telephone = '" . tep_db_input($update_customer_telephone) . "',
	customers_email_address = '" . tep_db_input($update_customer_email_address) . "',";

 

REPLACE

		
$UpdateOrders = "UPDATE " . TABLE_ORDERS . " SET 
	customers_name = '" . tep_db_input(stripslashes($_POST['update_customer_name'])) . "',
	customers_company = '" . tep_db_input(stripslashes($_POST['update_customer_company'])) . "',
	customers_street_address = '" . tep_db_input(stripslashes($_POST['update_customer_street_address'])) . "',
	customers_suburb = '" . tep_db_input(stripslashes($_POST['update_customer_suburb'])) . "',
	customers_city = '" . tep_db_input(stripslashes($_POST['update_customer_city'])) . "',
	customers_state = '" . tep_db_input($update_customer_state) . "',
	customers_postcode = '" . tep_db_input(stripslashes($_POST['update_customer_postcode'])) . "',
	customers_country = '" . tep_db_input($update_customer_country) . "',
	customers_telephone = '" . tep_db_input(stripslashes($_POST['update_customer_telephone'])) . "',
	customers_email_address = '" . tep_db_input(stripslashes($_POST['update_customer_email_address'])) . "',";


__

 

Duende

Share this post


Link to post
Share on other sites

Damn ... I'm letting some timer run out and then I can't complete my edit ...

 

Here's the rest of my post:

 

We need someone smarter in PhP and osCommerce than myself, but I saw right off the bat that the stripslashes function completely replaced the original (in my case from version 2.8.1) the ...

 

tep_db_prepare_input($_POST['update_customer_name'])

 

Now, tep_db_prepare_input(stripslashes($_POST['update_customer_name'])) actually worked like the original. E.G. Any apostrophes would throw and error. So I compromised using the stripslashes with version 2.8.2's tep_db_input. Who knows how badly we can get hacked, but at least this is in the admin section, so we're probably OK.

 

Let me know if this works for those having trouble saving the main customer address in Order Editor 2.8.2 (admin/edit_orders.php)


__

 

Duende

Share this post


Link to post
Share on other sites

I have a problem with totals with taxes when I enter a rebate, let say a 10$ amount, the taxe field value is changed automatically. It must be some javascript in the page. When I click update the value is taken out of the page but it's not there after the resfreh. Let say 10$ it's still showing -10. Same thing when I add or remove products.

 

I have version 2.8.2 please help me.

Share this post


Link to post
Share on other sites

Incorporating the Edit Comments Contribution into the Order Editor.

 

Currently, I have the Order Editor 2.8.2 and Edit Comments (found here).

 

Had a brief chat or two with Insomniac2 about integrating these two contributions. The original Edit Comments has directions for placing it in the original admin/orders.php file. Once I picked up on the subtle clue, it became very easy to integrate these two. Feel free to first read the "Tying it all together" comment at the end of this message. So here it is:

 

FILE: admin/edit_orders.php

FIND:

  if (($action == 'edit') && isset($_GET['oID'])) {
$oID = tep_db_prepare_input($_GET['oID']);

$orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
$order_exists = true;
if (!tep_db_num_rows($orders_query)) {
  $order_exists = false;
  $messageStack->add(sprintf(ERROR_ORDER_DOES_NOT_EXIST, $oID), 'error');
}
 }

 

PLACE THIS (unedited) CODE BEFORE (basically right after the huge switch statement and before the code mentioned above):

	  /*
  * Edit comments
  */
  switch ($HTTP_POST_VARS['action_comment']) {
		  case 'edit_comment_true':
			  if(isset($HTTP_POST_VARS['txt_comment']) && isset($HTTP_POST_VARS['comment_id'])){
				tep_db_query("update " . TABLE_ORDERS_STATUS_HISTORY . "
							  set comments = '".tep_db_input($HTTP_POST_VARS['txt_comment'])."'
							  where orders_status_history_id = '" . tep_db_input($HTTP_POST_VARS['comment_id']) . "'");
			}
			  break;

		  case 'delete_comment_true':
			  if(isset($HTTP_POST_VARS['comment_id'])){
				tep_db_query("DELETE FROM  " . TABLE_ORDERS_STATUS_HISTORY . "
							  where orders_status_history_id = '" . tep_db_input($HTTP_POST_VARS['comment_id']) . "'");
			}
			  break;
  }
  /* **** Edit comments eof **** */

 

FIND: <!-- Begin Status Block --> , and then scroll down to where the status and comments table is built:

<?php
$orders_history_query = tep_db_query("select * from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");
if (tep_db_num_rows($orders_history_query)) {
 while ($orders_history = tep_db_fetch_array($orders_history_query)) {
echo '  <tr>' . "\n" .
	 '	<td class="smallText" align="center">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" .
	 '	<td class="dataTableHeadingContent" align="left" width="10"> </td>' . "\n" .
	 '	<td class="smallText" align="center">';
if ($orders_history['customer_notified'] == '1') {
  echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>\n";
} else {
  echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>\n";
}
echo '	<td class="dataTableHeadingContent" align="left" width="10"> </td>' . "\n" .
	 '	<td class="smallText" align="left">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "\n";
  echo '	<td class="dataTableHeadingContent" align="left" width="10"> </td>' . "\n" .
	   '	<td class="smallText" align="left">' . nl2br(tep_db_output($orders_history['comments'])) . ' </td>' . "\n";

 

PASTE IN RIGHT AFTER:

/* ******* 
Edit comments 
*********  */
echo	'			<td class="smallText">' . '</form>' .
							tep_draw_form('edit_comment', FILENAME_ORDERS_EDIT, tep_get_all_get_params(array()) ).
								tep_draw_hidden_field('comment_id',$orders_history['orders_status_history_id']);

								if($HTTP_POST_VARS['action_comment']=='edit_comment' && $HTTP_POST_VARS['comment_id'] == $orders_history['orders_status_history_id']) echo tep_image_submit('button_update.gif', IMAGE_EDIT);
								else echo tep_image_submit('button_edit.gif', IMAGE_EDIT);

								if($HTTP_POST_VARS['action_comment']=='edit_comment' && $HTTP_POST_VARS['comment_id'] == $orders_history['orders_status_history_id']){
									echo tep_draw_hidden_field('action_comment','edit_comment_true');
									echo '<br>'.tep_draw_textarea_field('txt_comment','soft',60,5,stripslashes(nl2br(tep_db_output($orders_history['comments']))));
								}else echo tep_draw_hidden_field('action_comment','edit_comment');
	echo   					'</form>'.' ';


	echo   					tep_draw_form('delete_comment', FILENAME_ORDERS_EDIT, tep_get_all_get_params(array()) );

								if($HTTP_POST_VARS['action_comment']=='delete_comment' && $HTTP_POST_VARS['comment_id'] == $orders_history['orders_status_history_id']){
									echo tep_draw_hidden_field('action_comment','delete_comment_true');
									echo '<br>'.TEXT_INFO_DELETE_COMMENT.'<br><br><br>';
								}else echo tep_draw_hidden_field('action_comment','delete_comment');

	echo   						tep_draw_hidden_field('comment_id',$orders_history['orders_status_history_id']);

								if($HTTP_POST_VARS['action_comment']=='delete_comment' && $HTTP_POST_VARS['comment_id'] == $orders_history['orders_status_history_id']) echo tep_image_submit('button_confirm.gif', IMAGE_CONFIRM);
								else echo tep_image_submit('button_delete.gif', IMAGE_DELETE);
	echo   					'</form> '.
					  '</td>' . "\n";
/* ******* Edit comments eof ********* */

 

FINALLY: ADD ANOTHER "Form" tep function right after (BUT before the "else"):

tep_draw_form('edit_order', FILENAME_ORDERS_EDIT, tep_get_all_get_params(array('action')) . 'action=update_order');

 

Mine looks like this: This code below finishes off the PHP block started in "<!-- Begin Status Block -->" mentioned above.

	/* ******* Edit comments eof ********* */

 echo '  </tr>' . "\n"  . tep_draw_form('edit_order', FILENAME_ORDERS_EDIT, tep_get_all_get_params(array('action')) . 'action=update_order');
 }
} else {
 echo '  <tr>' . "\n" .
   '	<td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" .
   '  </tr>' . "\n";
}
?>

 

TYING IT ALL TOGETHER:

Alright, it's a bit convoluted, but the reason that the Edit Comments code does not work in the Order Editor contribution is that the admin/edit_orders.php file uses a form across multiple sections and the Edit Comments code creates two new forms of its' own. Embedded html forms simply won't work. To keep things as simple as possible, install the Edit Comments switch statement in the spot indicated. That works for both the old admin/orders.php and the new admin/edit_orders.php.

 

Now if you look at the "PASTE IN RIGHT AFTER" code you'll see that I immediately close one form with </form>. While it's very messy HTML in my mind (... this whole damn original orders.php page is very bad, period, and the contributions are forced to follow it's example), it is better to change as little as possible. So we need to close that main form, allow Edit Comments to open and close its own forms, then we must open the main form back up again ... so all admin/edit_orders.php UPDATE buttons will work.

 

Please pay attention to your periods ( . ), "echo" commands and semi-colons ( ; ). I tried to keep the changes to the Edit Comments code and leave as much of the Edit Orders code alone, BUT you need to make sure that your code integrates and concatenates correctly.


__

 

Duende

Share this post


Link to post
Share on other sites

Sorry Folks, :'(

 

The post above has a bug in it where hitting the first two "Update" buttons on the admin/edit_orders.php page will actually add a blank comment.

 

Currently I'm a updating the page to hold textarea boxes so that we can edit the page just like the address fields and use the existing "update_order" case statement. Otherwise I'll need to write a new html block to accommodate what happens when a comment is added.

 

IDEA:

  • Edit the comments in place.
  • Add a delete button to delete the row.


__

 

Duende

Share this post


Link to post
Share on other sites
Guest

I went from V2.6.3 to V2.8.2 and am having problems with shipping- it won't show up in the "3. Discount, Shipping and Total" block (though it IS added into the final total correctly) but when I add a product the shipping cost is dropped for the entire order though the weight remains correct. I'm sure I missed something simple but I've been combing through this thread all afternoon and haven't found it yet- can anyone help?

Share this post


Link to post
Share on other sites
Alrighty ... if your customer's main address is disappearing in the edit_order.php, try this:

 

Thanks a bunch, works like a charm now :)

 

I absolutely LOVE that contribution :D

Thanks to all the guys involved :D

Share this post


Link to post
Share on other sites

HI all,

 

Ive tried to install it V2.8 and when I click on edit I get this? WHihc file need permissions?

 

Access Denied

 

No Right Permission Access

Please contact your Web Administrator to request

more access or if you found any problem.

 

 

Arthur

Share this post


Link to post
Share on other sites
Guest

Hi

I have installed this long needed feature ... BUT I get this error message:

 

Fatal error: Cannot redeclare tep_get_tax_description() (previously declared in /hsphere/local/home/***/admin/includes/functions/general.php:16) in /hsphere/local/home/***/admin/includes/functions/oe_functions.php on line 20

 

Here is the code

 

  function tep_get_tax_description($class_id, $country_id, $zone_id) {
$tax_query = tep_db_query("select tax_description from " . TABLE_TAX_RATES . " tr left join " . TABLE_ZONES_TO_GEO_ZONES . " za on (tr.tax_zone_id = za.geo_zone_id) left join " . TABLE_GEO_ZONES . " tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '" . (int)$country_id . "') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '" . (int)$zone_id . "') and tr.tax_class_id = '" . (int)$class_id . "' order by tr.tax_priority");
if (tep_db_num_rows($tax_query)) {
  $tax_description = '';
  while ($tax = tep_db_fetch_array($tax_query)) {
	$tax_description .= $tax['tax_description'] . ' + ';
  }
  $tax_description = substr($tax_description, 0, -3);

  return $tax_description;
} else {
  return ENTRY_TAX;
}
 }

 

This code is also in general.php

 

Any suggestions to what I should do to fix this?

 

P.S. Thank you for å nice contribution!

Share this post


Link to post
Share on other sites
Let me know if this works for those having trouble saving the main customer address in Order Editor 2.8.2 (admin/edit_orders.php)

 

This did work -- but when i changed the code as suggested, for whatever reason the edit_order screens have lost their formatting -- almost as if whatever css was applied before is not working now ... any ideas?

Share this post


Link to post
Share on other sites
Guest
Hi

I have installed this long needed feature ... BUT I get this error message:

 

Fatal error: Cannot redeclare tep_get_tax_description() (previously declared in /hsphere/local/home/***/admin/includes/functions/general.php:16) in /hsphere/local/home/***/admin/includes/functions/oe_functions.php on line 20

 

>snipped for space<

 

This code is also in general.php

 

Any suggestions to what I should do to fix this?

 

P.S. Thank you for å nice contribution!

This got me too- the instructions were in an earlier update and are repeated here in the forum on (I believe) page 73

Share this post


Link to post
Share on other sites
Guest

Dear OscDevelopers,

 

 

I have installed Order Editor (version 2.8.2) and is working quite alright. The only thing is that not any (almost) of the javascripts work. When I take my mouse over the information image, it works fine, but the calculation and the "Same as billing address" is not working at all. I get a javascript error where it says "Object not found".

 

 

Could any of you OSC-gurus help out? I would really appreciate it!

 

Thank you very much!

 

Regards

Julian Alison

Share this post


Link to post
Share on other sites

I have a very simple question, hopefully someone can shed some light on the issue...

 

With the order discount, this will obviously be processed AFTER the customer has already made their order and paid through the gateway. How is that of any use? This means they are paying full price and then you have to organise a refund of the discount ammount.

 

I'm sure it must work another way or theres not much point in that feature. Can someone explain this please?

 

OR does payment actually only occur once the status of the order changes?

 

Any help is MUCH appreciated!

Thank you!!!

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

×