Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

jhilgeman

NEW! Complete Order Editing Tool!

Recommended Posts

I have installed order editor and it works fine. However my store needs to use the 'free of charge' payment module contribution. When I have this payment module enabled (that appears when the shopping cart has a total of $0), I recieve a fatal error in the order editor.

 

The error message I receive is:

 

Fatal error: Call to a member function show_total() on a non-object in /home/public_html/************/includes/modules/payment/freeofcharge.php on line 42

 

I have included the contents of freeofcharge.php below:

 

<?php




 class freeofcharge {

var $code, $title, $description, $enabled;



// class constructor

function freeofcharge() {

  global $order;



  $this->code = 'freeofcharge';

  $this->title = MODULE_PAYMENT_FOC_TEXT_TITLE;

  $this->description = MODULE_PAYMENT_FOC_TEXT_DESCRIPTION;

  $this->sort_order = MODULE_PAYMENT_FOC_SORT_ORDER;

  $this->enabled = ((MODULE_PAYMENT_FOC_STATUS == 'True') ? true : false);

  if (is_object($order)) $this->update_status();

}



// class methods

function update_status() {

  global $order;



// disable the module if the order only contains virtual products

  if ($this->enabled == true) {

	global $cart;

	if ($cart->show_total() >= 0.01) {

	  $this->enabled = false;

	}

  }

}



function javascript_validation() {

  return false;

}



function selection() {

  return array('id' => $this->code,

			   'module' => $this->title);

}



function pre_confirmation_check() {

  return false;

}



function confirmation() {

  return false;

}



function process_button() {

  return false;

}



function before_process() {

  return false;

}



function after_process() {

  return false;

}



function get_error() {

  return false;

}



function check() {

  if (!isset($this->_check)) {

	$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_FOC_STATUS'");

	$this->_check = tep_db_num_rows($check_query);

  }

  return $this->_check;

}



function install() {

  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Cash On Delivery Module', 'MODULE_PAYMENT_FOC_STATUS', 'True', 'Do you want to accept Cash On Delevery payments?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");

  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_FOC_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");

  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_FOC_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");

  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_FOC_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");

  }



function remove() {

  tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");

}



function keys() {

  return array('MODULE_PAYMENT_FOC_STATUS', 'MODULE_PAYMENT_FOC_ZONE', 'MODULE_PAYMENT_FOC_ORDER_STATUS_ID', 'MODULE_PAYMENT_FOC_SORT_ORDER');

}

 }

?>

 

 

 

If anyone could help me out with the compatibility issue, your help would be greatly appreciated.

Share this post


Link to post
Share on other sites

Discover a bug in the Order Editor v2.6.3 that I am using.

 

I have an extra FUEL surcharge (12.5%) for oversea shipping, based on the shipping cost.

 

After customer made order, it recorded down fine with:

 

Shipping Cost = US$100

Fuel Surcharge = US$12.50

 

After I edited the order and saved, it automatically DELETED my Fuel Surcharge column! I have to manually insert it back on again.

 

How to correct this?


Best regards,

Koh Kho King

Share this post


Link to post
Share on other sites
Guest

Hi

I'm having some problems getting the ot_total to add up correctly.

I use ot_total_ht(total without tax) then ot_tax wich add up to ot_sub_total, then I use a shipping mod and then ot_total.

 

The problem is that the ot_total is adding up both ot_total_ht and ot_sub_total and then it adds up the shipping.

 

it should just add up ot_sub_total and the shipping.

 

Anyone know how to fix this?

Share this post


Link to post
Share on other sites

Hello,

 

i have the same problem with the tool and simply comment the lines out (/* */):

 

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

 

But now it have recognised that, if i update a order, the description for the tax is lost.

 

Did you resolve the problem??

 

Best regards,

kobby

Edited by kobby

Share this post


Link to post
Share on other sites
Guest

Hi I have searched the forum but can not find an answer

 

My prices have tax on them but I do not want the tax amount to be displayed on the invoice. How do i remove it from the invoice.

 

If an order is created normaly with out editing the tax is not displayed as it is turned of in admin modules Order Total

 

Thanks

Edited by fzx5v0

Share this post


Link to post
Share on other sites
Hello,

 

i have the same problem with the tool and simply comment the lines out (/* */):

 

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

 

But now it have recognised that, if i update a order, the description for the tax is lost.

 

Did you resolve the problem??

 

Best regards,

kobby

 

It's been a while since I've worked on this, but I believe you have to delete the function from general.php and have it included in oe_functions.php (really you shouldn't edit oe_functions.php at all for 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
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

 

What browser are you using?


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
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) . "',";

 

The problem with this code isn't the use of tep_db_input vs. tep_db_prepare_input, with or without stripslashes, it's the lack of the use of $_POST (aka $HTTP_POST_VARS for those of you using very old versions of PHP) to control each variable.

 

The proper format for these lines of code is

variable_name = '" . tep_db_prepare_input($_POST['update_variable_name']) . "',

 

ie, that whole section should be

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

 

customer_state and customer_state don't use $_POST because they're not POSTed variables; they're determined by the code using variables that are POSTed.

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
Discover a bug in the Order Editor v2.6.3 that I am using.

 

I have an extra FUEL surcharge (12.5%) for oversea shipping, based on the shipping cost.

 

After customer made order, it recorded down fine with:

 

Shipping Cost = US$100

Fuel Surcharge = US$12.50

 

After I edited the order and saved, it automatically DELETED my Fuel Surcharge column! I have to manually insert it back on again.

 

How to correct this?

 

Look at the orders_total table for information from a brand new order (not edited with Order Editor). The "value" and "text" fields should correspond (i.e. if text is $12.50 then value should be 12.50). If the "value" field is blank, NULL, or zero, then that's why Order Editor is deleting it.

 

If that is the case, then there's something wrong with your Fuel Surcharge contribution because it's not writing all the necessary information to your database. But, in this case, you can change Order Editor to not delete your fuel surcharge.

 

Change

	if (!trim($ot_value) && ($ot_class != "ot_shipping") && ($ot_class != "ot_subtotal") && ($ot_class != "ot_total")) { // value = 0 => Delete Total Piece

to

	if (!trim($ot_value) && ($ot_class != "ot_shipping") && ($ot_class != "ot_fuel_surcharge") && ($ot_class != "ot_subtotal") && ($ot_class != "ot_total")) { // value = 0 => Delete Total Piece

where "ot_fuel_surcharge" should be whatever is stored in the "class" column of the orders_total table for those entries.

 

That's my theory, anyway, try it out and see how it goes.


Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites
I have installed order editor and it works fine. However my store needs to use the 'free of charge' payment module contribution. When I have this payment module enabled (that appears when the shopping cart has a total of $0), I recieve a fatal error in the order editor.

 

The error message I receive is:

 

Fatal error: Call to a member function show_total() on a non-object in /home/public_html/************/includes/modules/payment/freeofcharge.php on line 42

 

I have included the contents of freeofcharge.php below:

 

If anyone could help me out with the compatibility issue, your help would be greatly appreciated.

 

Disable the payment method dropdown.


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
With the order discount, this will obviously be processed AFTER the customer has already made their order and paid through the gateway. This means they are paying full price and then you have to organise a refund of the discount ammount.

 

That is correct. If you want to give them a discount after they've paid, then you have to refund them manually.


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'm having some problems getting the ot_total to add up correctly.

I use ot_total_ht(total without tax) then ot_tax wich add up to ot_sub_total, then I use a shipping mod and then ot_total.

 

The problem is that the ot_total is adding up both ot_total_ht and ot_sub_total and then it adds up the shipping.

 

it should just add up ot_sub_total and the shipping.

 

Anyone know how to fix this?

 

Is this happening when you update the order, when you add products, or both?


Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites
Guest
The problem with this code isn't the use of tep_db_input vs. tep_db_prepare_input, with or without stripslashes, it's the lack of the use of $_POST (aka $HTTP_POST_VARS for those of you using very old versions of PHP) to control each variable.

 

The proper format for these lines of code is

variable_name = '" . tep_db_prepare_input($_POST['update_variable_name']) . "',

 

ie, that whole section should be

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

 

customer_state and customer_state don't use $_POST because they're not POSTed variables; they're determined by the code using variables that are POSTed.

 

 

This is interesting- when I checked my table for this I found that the numbers are being carried but not properly for either the Total or Coupons- they have <b> and </b> around it. Could this be why my shipping is being dropped? Or is it, since it seems to show up for Total from the very first order before I ever modded anything, nothing to worry about?

(example:

title text value

Total: <b>$8.12</b> 8.1200

Discount Coupons:c3b359: <b>-$3.28</b> 3.2800)

Share this post


Link to post
Share on other sites
This is interesting- when I checked my table for this I found that the numbers are being carried but not properly for either the Total or Coupons- they have <b> and </b> around it. Could this be why my shipping is being dropped? Or is it, since it seems to show up for Total from the very first order before I ever modded anything, nothing to worry about?

(example:

title text value

Total: <b>$8.12</b> 8.1200

Discount Coupons:c3b359: <b>-$3.28</b> 3.2800)

 

That's normal- the text field is a varchar field, so there can be HTML and special characters in there. Dropping the shipping entry completely doesn't have anything to do with what's entered in the text field for other entries.


Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites
Guest
That's normal- the text field is a varchar field, so there can be HTML and special characters in there. Dropping the shipping entry completely doesn't have anything to do with what's entered in the text field for other entries.

Ah darn it- I was really hoping for a simple fix- thank you though.

Share this post


Link to post
Share on other sites
Ah darn it- I was really hoping for a simple fix- thank you though.

 

Explain in detail the problem and when it occurs and I will try to duplicate it.


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
Before the last version there was added:

SearchSuggest_Update

it is a pretty good thing to have , however it seem to hold some bugs.

When i type in a model number al show up verry nice , however i see it loose the order_id [oid].

Also when i click on the selected product from the list i see it make a verry strange html code in it.

it go so fast i only could reconize it holded <b>www.mydomain.com< , then 1 second after it add my selected product name in the textbox.

I think this searchsuggestion update is good to have , couse many store owner work with model number.

So if there's a chance someone can look again at this , then i and some other would be verry pleased.

 

Grtzzz wHiTeHaT

 

it is :SearchSuggest_Update for v2.8.1

http://www.oscommerce.com/community/contri.../download,15218

 

It does look like a cool mod if we can get it working properly. If I get a chance I will take a closer look at it.


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
ok... my previous post is solved , atleast for me.

 

if you not want the special fancy stuff inside the search result and only need to find the correct product.

 

you replace line 20 of SearchSuggest with this 1:

	$sql = "select * from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS . " p on pd.products_id = p.products_id WHERE p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and (pd.products_name like '%" . tep_db_input($search) . "%' or  p.products_model like '%" . tep_db_input($search) . "%') LIMIT 15";

 

I changed

(int)$_GET['oID']

to

$_GET['oid']

at line 59 and that cleared up the Order ID 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
Guest
Explain in detail the problem and when it occurs and I will try to duplicate it.

When a new order comes in it looks fine and shipping is included in the total though it's not displayed (it shows sub-total and then total and the total is correct WITH shipping so it's being added in even though it's no longer displayed) since I added this. When I click on 'edit' as long as I hit 'back' without actually editing anything it's still fine but if I click on 'update' at the bottom, whether I change anything or not, shipping is simply dropped completely from the total. Somewhere, it seems to me but I'm guessing since I really don't 'know' php but just generally muddle my way through (let's hear it for cut and paste!), it's not passing the shipping variable properly but I haven't even the first clue which section to start looking for the problem.

Share this post


Link to post
Share on other sites
When a new order comes in it looks fine and shipping is included in the total though it's not displayed (it shows sub-total and then total and the total is correct WITH shipping so it's being added in even though it's no longer displayed) since I added this. When I click on 'edit' as long as I hit 'back' without actually editing anything it's still fine but if I click on 'update' at the bottom, whether I change anything or not, shipping is simply dropped completely from the total. Somewhere, it seems to me but I'm guessing since I really don't 'know' php but just generally muddle my way through (let's hear it for cut and paste!), it's not passing the shipping variable properly but I haven't even the first clue which section to start looking for the problem.

 

Look in your database, in the orders_total table, at the order information for an order that you have not touched with Order Editor, and tell me what the entries for "text", "value", and "class" are for the shipping component in the order.


Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Share this post


Link to post
Share on other sites
Guest
Look in your database, in the orders_total table, at the order information for an order that you have not touched with Order Editor, and tell me what the entries for "text", "value", and "class" are for the shipping component in the order.

Hmm- it comes up as custom:

$2.55 2.5500 ot_custom

Share this post


Link to post
Share on other sites
Guest
It's saved as custom by the checkout process?

It's listed as ot_custom:

 

text value class

$2.55 2.5500 ot_custom

Share this post


Link to post
Share on other sites
It's listed as ot_custom:

 

text value class

$2.55 2.5500 ot_custom

 

That's very strange, because ot_custom is used by Order Editor as the class value for additional fees added in by admin when using Order Editor. I've never heard of a shipping module using that class value. Shipping charges should be stored as ot_shipping. Are you sure this isn't one that you had to add back in using Order Editor after the original component disappeared?


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 just installed the new version of this contribution (v2.8.4), and get the following error when I try to install a product (after clicking on its name or model):

 

Fatal error: Call to undefined function: tep_html_no_oe_quote() in c:\program files\easyphp1-8\www\catalog\admin\edit_orders.php on line 2207

 

The 2.8.3 version was working just fine. Where should I add this function for the contribution to work?

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

×