Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

NEW! Complete Order Editing Tool!


jhilgeman

Recommended Posts

It also has same problem with flat rate. using IE7 and Firefox

 

I just tested it with the flat rate and disabled the UPS XML Quotes. Had the same problem, tested in IE7 and Firefox as well (win XP).

 

It looks like the ajax call is not picking up the value being set. When I try to change my shipping quote to 'Flat Rate', I can see the value (5) being set in the textbox in the order totals box. Then the ajax call starts and doesn't seem to get the new value.

Link to comment
Share on other sites

It also has same problem with flat rate. using IE7 and Firefox

 

Does the entire shipping method title get written when using UPS XML, acronym and all?

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 just tested it with the flat rate and disabled the UPS XML Quotes. Had the same problem, tested in IE7 and Firefox as well (win XP).

 

It looks like the ajax call is not picking up the value being set. When I try to change my shipping quote to 'Flat Rate', I can see the value (5) being set in the textbox in the order totals box. Then the ajax call starts and doesn't seem to get the new value.

 

What happens if you type 5 in the box and hit the tab key?

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

Does the entire shipping method title get written when using UPS XML, acronym and all?

 

Yes, I thought it might have something to do with that so I disabled the UPS XML shipping and still had the same problem.

Link to comment
Share on other sites

Alright, sorry for wasting your time. I never applied the bug fix outlined in Post 2130 $shipping=array();

 

Fudge- I knew I should have mentioned that, but it's always worked fine for me with or without $shipping=array(); so I thought that couldn't be it, that it had to be something with the javascript.

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

GREAT! Everything is working well now. The onlything thats driving me crazy is these odd characters that keep coming up in the description for the shipping in the total box.

 

For example:

3 Day Select (3 Day Select Shipping):

 

Ground ( Standard Ground Shipping):

 

Whats with the Â. Im sure its something stupid Im missing but its driving me nuts

Link to comment
Share on other sites

Its realy odd but I get that character" Â. "no matter which shipping option I choose. When I go to manualy remove it AJAX kick in and puts it back. It only adds it after the first word of the description. It must be in the ajax script some place.

Link to comment
Share on other sites

Its realy odd but I get that character" Â. "no matter which shipping option I choose. When I go to manualy remove it AJAX kick in and puts it back. It only adds it after the first word of the description. It must be in the ajax script some place.

 

Well it only happens to me in IE7, and opera firefox works fine.

????????

Edited by jcoleman2007
Link to comment
Share on other sites

Kang,

 

tell me .. is this what your edit case looks like in edit_orders.php

		case 'edit':
		if (isset($_GET['oID'])) {
			if (!tep_session_is_registered('order')) {
				tep_session_register('order');
			}
			$oID = tep_db_prepare_input($_GET['oID']);
			$order = new oe_order($oID);

			if ($order->info['shipping_method'] == null) {
				$Query = "SELECT title FROM " . TABLE_ORDERS_TOTAL . "
						WHERE class = 'ot_shipping'
						AND orders_id = '" . (int)$oID . "'";
				$result = tep_db_query($Query);
				$row = tep_db_fetch_array($result);

				$order->info['shipping_method'] = $row['title'];
			}
			if (!$order->exists) {
				  $messageStack->add(sprintf(ERROR_ORDER_DOES_NOT_EXIST, $oID), 'error');
			}
		  }
 		break; //end case 4 (edit)

 

this is my complete edit case .. you commented that section of code in the middle out..but make sure that it looks something similar to this.. if youre missing something then thats probably why it wasnt working..

 

J

Hey J,

 

Yeah mine is the same but if I uncomment the section I posted i get the error order not found!!! but commented i am able to access the (order) edit page!!! however the shipping is still not working properly due to this code not getting the shipping method... The third if statement is the one coursing me grief!!

if ($order->info['shipping_method'] == null) {.....etc

 

Any ideas??

Link to comment
Share on other sites

Hey J,

 

Yeah mine is the same but if I uncomment the section I posted i get the error order not found!!! but commented i am able to access the (order) edit page!!! however the shipping is still not working properly due to this code not getting the shipping method... The third if statement is the one coursing me grief!!

if ($order->info['shipping_method'] == null) {.....etc

 

Any ideas??

 

Did you update the database? and add the shipping field in?

 

 

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

ALTER TABLE orders ADD shipping_method VARCHAR(255) ;

 

if you already had the older 3.0.2.1 then you would have had a shipping tax field.. you would need to run this query instead of the one above

 

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

ALTER TABLE orders ADD shipping_method VARCHAR(255) ;

 

now open admin/includes/classes/oe_order.php

 

and make sure the lines

 

### FIND near line: 51

 

'shipping_tax' => $order['shipping_tax'],

 

### REPLACE WITH:

 

'handling_fee' => $order['handling_fee'],

'shipping_method' => $order['shipping_method'],

 

so make sure you have the handling_fee and shipping_method fields there..

 

if that still doesnt work.. then it could be something at the very top of edit_orders.php this is the top of my file..

 

	// First things first: get the required includes, classes, etc.
require('includes/application_top.php');
require('includes/classes/http_client.php');

require(DIR_WS_CLASSES . 'currencies.php');
$currencies = new currencies();

require(DIR_WS_FUNCTIONS . 'oe_functions.php');
require(DIR_WS_CLASSES . 'oe_order.php');

// include order cart class
require(DIR_WS_CLASSES . 'order_cart.php');

// load all enabled shipping modules
  require(DIR_FS_CATALOG . 'includes/classes/shipping.php');
  $shipping_modules = new shipping;

// define the number of custom charge fields
define(CUSTOM_FIELDS, 3);

if (isset($_POST['total_order_weight'])) {
	$total_weight = $_POST['total_order_weight'];
} else {
	$total_weight = 0;
}


// create the order cart & fix the cart if necesary
if (tep_session_is_registered('cart') && is_object($cart)) {
	if (PHP_VERSION < 4) {
		  $broken_cart = $cart;
		  $cart = new orderCart((int)$_GET['oID']);
		  $cart->unserialize($broken_cart);
	} else {
		$cart = new orderCart((int)$_GET['oID']);
	}
} else {
	tep_session_register('cart');
	$cart = new orderCart((int)$_GET['oID']);
}

//set a default tax class
//shipping tax is added to the default tax class
$default_tax_class = ORDER_EDITOR_DEFAULT_TAX_CLASS;
//if your shipping tax is not being added to the proper tax component
//most likely you need to change the setting of $default_tax_class
//this is configurable in the My Store section of the admin panel

// Then we get down to the nitty gritty
$orders_statuses = array();
$orders_status_array = array();
$orders_status_query = tep_db_query("SELECT orders_status_id, orders_status_name
									FROM " . TABLE_ORDERS_STATUS . "
									WHERE language_id = '" . (int)$languages_id . "'");

// Get List of Order Status Levels
while ($orders_status = tep_db_fetch_array($orders_status_query)) {
	$orders_statuses[] = array('id' => $orders_status['orders_status_id'],
							   'text' => $orders_status['orders_status_name']);

	$orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];
}

// Get $action from _GET if its been set otherwise set to edit
$action = (isset($_GET['action']) ? $_GET['action'] : 'edit');
// Update Inventory Quantity
if (tep_not_null($action)) {
	  switch ($action) {

Link to comment
Share on other sites

GREAT! Everything is working well now. The onlything thats driving me crazy is these odd characters that keep coming up in the description for the shipping in the total box.

 

For example:

3 Day Select (3 Day Select Shipping):

 

Ground ( Standard Ground Shipping):

 

Whats with the Â. Im sure its something stupid Im missing but its driving me nuts

 

In admin/edit_orders.php find at about line 1371

<input type="hidden" id="update_shipping['.$r.'][title]" name="update_shipping['.$r.'][title]" value="'.$shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'].'):">

and change it to

<input type="hidden" id="update_shipping['.$r.'][title]" name="update_shipping['.$r.'][title]" value="'.$shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'].'):">

 

Next find in admin/edit_orders_ajax.php at about line 393

<input type="hidden" id="update_shipping['.$r.'][title]" name="update_shipping['.$r.'][title]" value="'.$shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'].'):">

and change it to

<input type="hidden" id="update_shipping['.$r.'][title]" name="update_shipping['.$r.'][title]" value="'.$shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'].'):">

 

Next find in admin/edit_orders_ajax.php at about line 659

<input type="hidden" id="update_shipping['.$r.'][title]" name="update_shipping['.$r.'][title]" value="'.$shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'].'):">

and change it to

<input type="hidden" id="update_shipping['.$r.'][title]" name="update_shipping['.$r.'][title]" value="'.$shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'].'):">

 

Once you have done this, to fix any quotes already in the database you can either overwrite them with a shipping quote or manually delete the weird character and the space to its immediate right, then reinsert the space with your spacebar.

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

 

got a strange issue.i made few changes to edit_orders to get subtotal excluding vat to work(thanks to djmonkey1 for his help).Now the problem i have it dat when a customers places a order the calculation are all okay. vat gets added to the shipping.and the total includes tax for shipping and products.when i click on edit order to update order process and click on update the total changes changes .It now excludes shipping tax.

 

any help would be appreciated.

Go to the top of the pageReport Post

 

 

Edit Post

Link to comment
Share on other sites

Although Order Editor 5.0 has been released by djmonkey. I wanted to complete the version 4.0 line. The last thing pending was Payment Processing. Well im happy to say its done and has been added. I will release it tomorrow or day after once the documentation is done.. and if anyone wishes to use it I will support it with any bug fixes that may be necessary.. I am currently using it and will continue to use it until I am finish modifying 5.0 to suit my needs.

 

You most likely wont use the payment processing feature unless you are creating orders on the admin side.. but its there..and it should work just fine.

 

here are some screen shots..

 

payment module selected, enter card information

s1.jpg

 

hit update and retrieve card information

s2.jpg

 

after adding products and updating the shipping quote, finalize order

s3.jpg

 

finish the order by confirming

s4.jpg

Link to comment
Share on other sites

I'm getting a strange error in v4.0.2 when I try to Create OR Edit an order

 

Fatal error: Cannot redeclare tep_get_products_special_price() (previously declared in ...includes/functions/general.php)

in .../includes/functions/oe_functions.php on line 262

 

How can I fix this?

Edited by homewetbar

Most Valuable OsCommerce Contributions:

Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294

FedEx Automated Labels -- Contribution 2244

RMA Returns system -- Contribution 1136

Sort Products By Dropdown -- Contribution 4312

Ultimate SEO URLs -- Contribution 2823

Credit Class & Gift Voucher -- Contribution 282

Cross-Sell -- Contribution 5347

Link to comment
Share on other sites

I'm getting a strange error in v4.0.2 when I try to Create OR Edit an order

 

Fatal error: Cannot redeclare tep_get_products_special_price() (previously declared in ...includes/functions/general.php)

in .../includes/functions/oe_functions.php on line 262

 

How can I fix this?

 

 

Ah ok.. so it seems you have SPPC installed... is that correct? open your admin/includes/functions/general.php and find the tep_get_products_special_price() function.. if you have it there.. you wont need it in oe_functions.php .. so open admin/includes/functions/oe_functions.php and find the function.. compare the two they will probably be identical.. and just remove the one from oe_functions.php ..

Link to comment
Share on other sites

Ok getting somewhere... all seems to be working now up to the Request Real-Time Shipping Quotes:

I have 2 AusPost installed (auspost.php & auspostexpress.php) and local delivery (dly.php)

 

I only get AusPost Express quote showing with the image file under Request Real-Time Shipping with no check button

 

nothing else shows and in the drop down list there is only the 2 Auspost modules and Other but no Local Delivery

 

I have checked all files for country code ['country_id'] etc...

 

I even had an order with originally the local delivery and opened in editor... on update it totally dropped local delivery and only made avail the 2 auspost modules and other in the drop down & express under shipping service heading!!!

 

If i select Express in the drop down it does not update to the amount given as the "live quote" amount, any thoughts on whats still screwy here???

 

Cheers

M

Link to comment
Share on other sites

Ok getting somewhere... all seems to be working now up to the Request Real-Time Shipping Quotes:

I have 2 AusPost installed (auspost.php & auspostexpress.php) and local delivery (dly.php)

 

I only get AusPost Express quote showing with the image file under Request Real-Time Shipping with no check button

 

nothing else shows and in the drop down list there is only the 2 Auspost modules and Other but no Local Delivery

 

I have checked all files for country code ['country_id'] etc...

 

I even had an order with originally the local delivery and opened in editor... on update it totally dropped local delivery and only made avail the 2 auspost modules and other in the drop down & express under shipping service heading!!!

 

If i select Express in the drop down it does not update to the amount given as the "live quote" amount, any thoughts on whats still screwy here???

 

Cheers

M

 

So what did you have to add.. was it the database fields? when you installed did you do all the steps in the install.txt and the upgrade.txt ? you didnt just replace the files right you actually did the edits?

Link to comment
Share on other sites

which version of local delivery module do you have? the latest is 1.6 and thats what Im looking at right now..

 

there are 2 places where the module needs to be modified.. both are ['country']['id'] changes to ['country_id']

Link to comment
Share on other sites

I just realized there were two javascript functions I created that are used in 4.0.2 that I didnt include in the upgrade instructions..

 

these are necessary for the 'live quote' updating .. the other is for the payment method module fields..

 

This function is needed if you have upgraded to 4.0.2

 

open edit_orders.php and find the javascript function checkAllBoxes(box) { around line 1640 ..

 

place the function below right above that function ..

/**
* Update the Shipping Field from the Real-Time Quote Selection
* @access public
* @return void
**/
function update_delivery_cost(method, cost){
var delivery_field = document.getElementById("delivery_method");
var delivery_value = document.getElementById("delivery_value");

  var i;
for (i = 0; i < delivery_field.length; i++) {
	if (method.search(delivery_field.options[i].value) != -1) {
		delivery_field.selectedIndex = i;
		delivery_value.value = cost;
	}
}
}

Link to comment
Share on other sites

Ah ok.. so it seems you have SPPC installed... is that correct? open your admin/includes/functions/general.php and find the tep_get_products_special_price() function.. if you have it there.. you wont need it in oe_functions.php .. so open admin/includes/functions/oe_functions.php and find the function.. compare the two they will probably be identical.. and just remove the one from oe_functions.php ..

 

Thanks, it was recover cart sales that installed that already so I removed the other reference from oe_function.php like you suggested which fixed that error.

 

Now I'm getting a new error when I try to edit an order:

Fatal error: Unknown(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition ordercart of the object you are trying to operate on was loaded _before_ the session was started in /home/homewe5/public_html/test/includes/classes/shipping.php on line 20

 

I seem to be able to fix it by commenting out

require(DIR_FS_CATALOG . 'includes/classes/shipping.php');

$shipping_modules = new shipping;

 

in edit_orders.php but will there be problems caused by commenting this out? Can you suggest a better work around?

Most Valuable OsCommerce Contributions:

Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294

FedEx Automated Labels -- Contribution 2244

RMA Returns system -- Contribution 1136

Sort Products By Dropdown -- Contribution 4312

Ultimate SEO URLs -- Contribution 2823

Credit Class & Gift Voucher -- Contribution 282

Cross-Sell -- Contribution 5347

Link to comment
Share on other sites

Thanks, it was recover cart sales that installed that already so I removed the other reference from oe_function.php like you suggested which fixed that error.

 

Now I'm getting a new error when I try to edit an order:

Fatal error: Unknown(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition ordercart of the object you are trying to operate on was loaded _before_ the session was started in /home/homewe5/public_html/test/includes/classes/shipping.php on line 20

 

I seem to be able to fix it by commenting out

require(DIR_FS_CATALOG . 'includes/classes/shipping.php');

$shipping_modules = new shipping;

 

in edit_orders.php but will there be problems caused by commenting this out? Can you suggest a better work around?

 

Do you have this being loaded else where? .. possibly in admin/includes/application_top.php .. check to see that.. if it is your fix is fine.. if not the problem is elsewhere..

 

what about the functionality? does it seem to be working?

Link to comment
Share on other sites

Do you have this being loaded else where? .. possibly in admin/includes/application_top.php .. check to see that.. if it is your fix is fine.. if not the problem is elsewhere..

 

what about the functionality? does it seem to be working?

 

It's not in application_top.php and is no where else I'm aware of. We are using the multi-geo shipping and individual shipping contribs if that helps. It seems to work fine with that commented out though, but obviously the shipping part is not working...

Most Valuable OsCommerce Contributions:

Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294

FedEx Automated Labels -- Contribution 2244

RMA Returns system -- Contribution 1136

Sort Products By Dropdown -- Contribution 4312

Ultimate SEO URLs -- Contribution 2823

Credit Class & Gift Voucher -- Contribution 282

Cross-Sell -- Contribution 5347

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...