Zen Cart Logo
Forums / Addon Admin Tools / Edit Orders v4.0 Support Thread

Edit Orders v4.0 Support Thread

Views: 345,923

Results 501 to 520 of 1,927
7 Apr 2014, 2:10 PM
#501
avansant avatar

avansant

Zen Follower

Join Date:
Aug 2004
Posts:
122
Plugin Contributions:
0

Edit Orders v4.0 Support Thread

In the admin I am getting the message "Warning: Absolute's Product Attribute Grid was detected, however the Product Option Type for Attribute Grid was not fully installed in the database. Temporarily configuring PRODUCTS_OPTIONS_TYPE_ATTRIBUTE_GRID = 23997" whenever we go to the "orders" area in the admin. I tried reinstalling it. The version I had didn't have a database option to install (no SQL file).
The attribute grid group let me know it is edit orders generating this message. Can you tell me how to turn it off? Everything seems to be working...

7 Apr 2014, 2:46 PM
#502
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Edit Orders v4.0 Support Thread

avansant:

In the admin I am getting the message "Warning: Absolute's Product Attribute Grid was detected, however the Product Option Type for Attribute Grid was not fully installed in the database. Temporarily configuring PRODUCTS_OPTIONS_TYPE_ATTRIBUTE_GRID = 23997" whenever we go to the "orders" area in the admin. I tried reinstalling it. The version I had didn't have a database option to install (no SQL file).
The attribute grid group let me know it is edit orders generating this message. Can you tell me how to turn it off? Everything seems to be working...
"Absolute's Product Attribute Grid" adds an extra "Product Option Type" to the database. However when testing compatibility with Edit Orders, we found "Absolute's Product Attribute Grid" does not follow the Zen Cart conventions (does not add the type to all locations in the database, does not use a constant, etc). This may cause unintended side effects and potential issues in the future when upgrading Zen Cart / installing additional plugins.

The "warning" will go away once the "Product Option Type" added by "Absolute's Product Attribute Grid" follows Zen Cart conventions. Please do not post "workarounds" in this thread on disabling the warning. Thank You.

7 Apr 2014, 3:30 PM
#503
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Edit Orders v4.0 Support Thread

southshorepizza:

If I give something to a customer for free I cannot zero out the tax on an order.
Why not? Changing either the product "tax rate" or "price" both affect the calculation of tax by the Order Total Module (ot_tax). Either can be set to "0" which indicates the product cost was "free" to the customer. This works 100% of the time in a "stock" Zen Cart installation.

NOTE 1: Changing a product to "free" after purchase should not be something one needs to do on a regular basis... If one is offering an item for "free" w/ purchase of XYZ, then an order total module should be used to automatically apply the necessary changes to the products / order.

NOTE 2: If you look closely at coupons (in the US) for "free" or "bogo" offers, you will usually see "excluding sales tax". Why? Because any applicable sales tax must still be paid if the item was "sold" (invoiced at a price greater than 0). If one is required to collect taxes for a location, one usually still needs to collect on the invoiced price.

NOTE 3: In the US you will see some companies list an item as a "gift". In this case they have changed the product itself to be free (and paid any applicable sales tax when they bought the product from the supplier). "Gifts" are not "sales" (and if under a certain amount per year and per recipient) may be exempt from taxation as they are not "sales". Keep in mind the company giving the "gift" in this case paid the applicable "sales" tax for the item when they purchased the item.

NOTE 4: One should consult a tax lawyer about the implications of offering "free" or "discounted" offers. Depending on where the discount is applied (item vs order) different tax rules may apply. Different tax rules may also apply depending upon geographical locations, sales date, and other factors.

7 Apr 2014, 8:15 PM
#504
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Edit Orders v4.0 Support Thread

southshorepizza:

... When you edit an order the quantity discount down in the total doesn't have a text box for the amount. ...
I am unable to duplicate this in a stock installation of Zen Cart 1.5+ with the current version of Edit Orders and the Quantity Discount order total module installed. When the Quantity Discount order total is present on an order, both the title and amount are shown inside editable textboxes.

southshorepizza:

... Unable to remove a quantity discount when editing an order. ... The discount also doesn't change if you remove any products. But that would be okay if I could adjust the amount of the discount or remove it. ...
The Quantity Discount order total module automatically calculates the discount amount for your order. The amount is calculated according to how one has configured Quantity Discounts. Because the amount is automatically configured one cannot modify the amount using Edit Orders (this is covered in the readme). This also means attempting to "remove" the Order Total will fail if the Order Total module says "Here is the amount you should charge / discount based upon the order".

I am able to successfully update an order (changing the products and quantities) and see the "Quantity Discount" amount change "automatically" according to settings I configured in a "test" store.

When the discount is no longer applicable for an order (no automatic order total data is returned), the Order Total can be removed the same way as any other order total module. Just clear both the title and the amount and click the update button.

I've verified both of the above on a stock Zen Cart 1.5.1 installation with the current version of Edit Orders and the Quantity Discount order total module installed.

NOTE 1: Currently "Edit Orders" will not remove Order Totals from an order automatically. This was done to support 3rd party modules which were unable to "automatically" calculate Order Total information when loaded in the Zen Cart admin interface.

NOTE 2: When you click "update" inside Edit Orders a number of things occur. Here is a SHORT list:

  1. The product data for each product is pulled from the database (same as during a customer checkout).
  2. The product data for each product is updated to reflect any changes entered on the Edit Orders page.
  3. The Order Total data for the order is calculated (same as during a customer checkout). Instead of using any custom code, Edit Orders calls the Zen Cart code handling modules.
  4. The Order Total data for the order is updated to reflect any changes entered on the Edit Orders page.
  5. The Order Total data for the order is re-calculated (same as during a customer checkout). This is done to allow modules doing "automatic calculation" (such as subtotal, tax, and total) to update their values.
8 Apr 2014, 3:00 AM
#505
southshorepizza avatar

southshorepizza

Zen Follower

Join Date:
Sep 2012
Posts:
253
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Sorry I miss understood what my manager was telling me. there is a box.
Attachment 13967

that you can make all the items above free and remove the coupons, and delete the words "quantity discount" and the amount "9.37" from.
Attachment 13969
However when you update and you get the
Attachment 13970
update successful box. You get a total of $2.51
Attachment 13971

I will try to recreate the quantity discount not getting removed. It may have been a browser issue at the store not reloading the entire page since we just upgraded this plugin. But this tax thing needs to be sorted out.

8 Apr 2014, 3:16 AM
#506
southshorepizza avatar

southshorepizza

Zen Follower

Join Date:
Sep 2012
Posts:
253
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Free order would be something didn't go right and to make the customer happy they just gave it to them. Perhaps there was a donation.

I called for specifics on quantity discount. He wanted to remove the quantity discount on a large order he sold at a special price. For example a pizza normally cost $10. A school called and wanted 10 and he sold them for $6.00 each. So he edits the order and makes each pizza $6.00 each. But because he has 10 pizzas he cannot get rid of the quantity discount. He has to figure out how much each pizza should cost before the quantity discount. I guess we just have to work around this now that we know what to expect.

8 Apr 2014, 3:47 PM
#507
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Edit Orders v4.0 Support Thread

southshorepizza:

... But this tax thing needs to be sorted out.
Yup, especially since I cannot duplicate the "tax thing" you are seeing in a stock Zen Cart 1.5.1 installation with Edit Orders and Quality Discounts. I'd "guess" a modification has been made to your store (and causing the issue)... Or "possibly" the example order you were working with is / was corrupt. Edit Orders does not calculate the tax (ot_tax or whatever tax plugin you have installed does).

8 Apr 2014, 3:58 PM
#508
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Edit Orders v4.0 Support Thread

southshorepizza:

Free order would be something didn't go right and to make the customer happy they just gave it to them. Perhaps there was a donation. ...
This would probably be best done using the "Onetime Discount" order total module and adding a note in the order comments as to why the discount was given.

Why? Using the "Onetime Discount" module provides an easy way to record and audit how many times an order is discounted (and how much overall revenue was lost due to unhappy customers, issues, etc). Using such an order total module would also ensure all invoices, reports, and the customer's order history reflect the customer was given a onetime discount.

11 Apr 2014, 12:01 PM
#509
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

lhungil, would you consider adding a couple of notifiers to the Edit Orders functions?

I've created some customizations that alter the handling of a product within an order and need to perform some additional processing when a product is removed and/or added to the order via Edit Orders. Following are the changes that I've made to /YOUR_ADMIN/includes/functions/extra_functions/edit_orders_functions.php to accomplish what I need:

function eo_add_product_to_order($order_id, $product) {
	global $db, $order, $zco_notifier;

...

	$order->products[] = $product;
  
  $zco_notifier->notify ('EDIT_ORDERS_ADD_PRODUCT', array ( 'order_id' => (int)$order_id, 'orders_products_id' => $order_products_id, 'product' => $product ));


	return $product;
}
function eo_remove_product_from_order($order_id, $orders_products_id) {
	global $db, $order, $zco_notifier;

	// First grab the order <==> product mappings
	$orders_products_id_mapping = eo_get_orders_products_id_mappings((int)$order_id);

	// Handle product stock
	if (STOCK_LIMITED == 'true') {
		$query = $db->Execute(
			'SELECT `products_id`, `products_quantity` ' .
			'FROM `' . TABLE_ORDERS_PRODUCTS . '` ' .
			'WHERE `orders_id`=\'' . (int)$order_id . '\' ' .
				'AND `orders_products_id`=\'' . (int)$orders_products_id . '\''
		);

		while (!$query->EOF) {
			if (DOWNLOAD_ENABLED == 'true') {
				$check = $db->Execute(
					'SELECT `p`.`products_quantity`, `pad`.`products_attributes_filename`, `p`.`product_is_always_free_shipping` ' .
					'FROM `' . TABLE_PRODUCTS . '` AS `p` ' .
					'LEFT JOIN `' . TABLE_PRODUCTS_ATTRIBUTES . '` AS `pa` ON `p`.`products_id`=`pa`.`products_id` ' .
					'LEFT JOIN `' . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . '` AS `pad` ON `pa`.`products_attributes_id`=`pad`.`products_attributes_id` ' .
					'WHERE `p`.`products_id` = \'' . (int)$query->fields['products_id'] . '\''
				);
			}
			else {
				$check = $db->Execute(
					'SELECT `p`.`products_quantity` FROM `' . TABLE_PRODUCTS . '` AS `p`' .
				 	'WHERE `p`.`products_id` = \'' . (int)$query->fields['products_id'] . '\''
				);
			}
			if (!$check->EOF && (DOWNLOAD_ENABLED != 'true' || $check->fields['product_is_always_free_shipping'] == 2 || !$check->fields['products_attributes_filename'] )) {
				$sql_data_array = array(
					'products_quantity' => $check->fields['products_quantity'] + $query->fields['products_quantity'],
					'products_ordered' => $check->fields['products_ordered'] - $query->fields['products_quantity']
				);
				if($sql_data_array['products_ordered'] < 0) $sql_data_array['products_ordered'] = 0;
				if($sql_data_array['products_quantity'] > 0) {

					// Only set status to on when not displaying sold out
					if (SHOW_PRODUCTS_SOLD_OUT == '0') {
						$sql_data_array['products_status'] = 1;
					}
				}

				zen_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update', 'products_id = \'' . (int)$query->fields['products_id'] . '\'');
			}

			$query->MoveNext();
		}
		unset($check, $query, $sql_data_array);
	}
  
  $zco_notifier->notify ('EDIT_ORDERS_REMOVE_PRODUCT', array ( 'order_id' => (int)$order_id, 'orders_products_id' => (int)$orders_products_id )); 

...

}
17 Apr 2014, 3:39 AM
#510
burtonte avatar

burtonte

New Zenner

Join Date:
Apr 2014
Location:
texas
Posts:
3
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

izar74:

Sorry Diva, the only purpouse of the post was to point out that the modules have problems together, and if someone already figured it out to say it.

New to this forum hope I am posting correctly. Sorry if this has been fixed but I searched and searched. I'm not a web site developer or hard core programmer but I had this problem when I originally installed edit orders v2. I fixed it then and forgot about it but I just upgraded to v4 with zen cart 1.5.1. When I did I was very careful to merge the core files but I just wasn't thinking and copied over some files. The same problem arouse. When you try to add an order from admin -- blank screen.

This is what I did to fix it.
includes/classes/order_total.php around line 81.

changed this:
if (!isset($GLOBALS[$class])) continue;

to this:
if (IS_ADMIN_FLAG)
if (isset($GLOBALS[$class])) continue;

17 Apr 2014, 2:42 PM
#511
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Edit Orders v4.0 Support Thread

burtonte:

... I'm not a web site developer or hard core programmer ... I just upgraded to v4 with zen cart 1.5.1. When I did I was very careful to merge the core files ... When (I) try to add an order from admin -- blank screen. ...
A "blank screen" in Zen Cart means a problem occurred. There WILL in most cases be a log of the issue. The starting point for diagnosing any problem is to locate any log file (Zen Cart debug log). The contents of the log files will usually tell you where (and why) a problem occurred and allow for troubleshooting. This log would be useful to the volunteers here at the Zen Cart forums (to help us help you).

Zen Cart does not natively (out of box) support creating a new order from the administrative interface. What "modification" are you using to "create" a new order using the Zen Cart admin? Name + Version + Link would be useful. If errors are occurring there is a good possibility something is not quite right with either the 3rd party module or the installation of the 3rd party module.

In a "stock" Zen Cart 1.5.1 installation, there is no code around line 81 of "/includes/classes/order_total.php" which looks like what you are describing. I am going to guess you (or someone else) made modifications to the file (introducing an issue)...

Edit Orders 4.1+ requires "/includes/classes/order_total.php" to properly load under both the catalog (store front) and admin interface. If order total modules or other processing are "excluded" via a check like the one you are describing other errors and miscalculations may occur. I would not recommend disabling portions of this critical module loader (as it appears your line of code may)...

NOTE 1: I would strongly suggest rechecking your upgrade to Zen Cart 1.5 and make sure all the core files were updated / merged correctly. Typically when upgrading Zen Cart one starts with clean files from the new version of Zen Cart, determines what alterations (if any) have been made to the old files, and only (if needed) applies the "changes". Doing a full merge can cause issues...

NOTE 2: Edit Orders 4.1+ includes a "slightly" modified version of "/includes/classes/order_total.php" designed to allow the "stock" (and most other) order total modules to load from the administrative side of Zen Cart. The one supplied with Edit Orders 4.1+ can directly replace the stock Zen Cart 1.5 version of the file.

17 Apr 2014, 10:31 PM
#512
burtonte avatar

burtonte

New Zenner

Join Date:
Apr 2014
Location:
texas
Posts:
3
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

I will try to supply as much info as I can. I am sunning zen cart 1.5.1 and I originally installed edit orders version 2.x.x. I have many many addons installed on top of the out-of-the box zen cart plus some of my own. I realize that this doesn't help but I seem to remember during the original install of zen cart and edit orders this problem arouse. I searched and searched then and found other people with the same problem when installing edit orders but no fixes. The log files complained about GetRewardPoints() as an undefined function. I assumed this was because it's not an admin function. I tried setting up the scope so admin could see this function but again I don't fully understand how php/zen cart handles scope. My assumption again was that reward points might not be calculated during an admin order entry. This was not a problem with me because I was going to use that as an excuse to drive customers to use my web site instead of phone orders but all seems to work for now. It's a new release so...we will see I'm sure

18 Apr 2014, 1:19 AM
#513
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Edit Orders v4.0 Support Thread

right... but keep in mind that no one can help you on the support forums with guesses. you really are going to have to post your error log messages.. it really helps the community to help you> burtonte:

I will try to supply as much info as I can. I am sunning zen cart 1.5.1 and I originally installed edit orders version 2.x.x. I have many many addons installed on top of the out-of-the box zen cart plus some of my own. I realize that this doesn't help but I seem to remember during the original install of zen cart and edit orders this problem arouse. I searched and searched then and found other people with the same problem when installing edit orders but no fixes. The log files complained about GetRewardPoints() as an undefined function. I assumed this was because it's not an admin function. I tried setting up the scope so admin could see this function but again I don't fully understand how php/zen cart handles scope. My assumption again was that reward points might not be calculated during an admin order entry. This was not a problem with me because I was going to use that as an excuse to drive customers to use my web site instead of phone orders but all seems to work for now. It's a new release so...we will see I'm sure

18 Apr 2014, 4:11 PM
#514
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Edit Orders v4.0 Support Thread

burtonte:

... I am sunning zen cart 1.5.1 and I originally installed edit orders version 2.x.x. I have many many addons installed on top of the out-of-the box zen cart plus some of my own. ...
Edit Orders 2.x and 4.1.x run completely different code. So what applied to a past version does not necessarily apply to the current version.

Edit Orders 2.x is not (to my knowledge) compatible with Zen Cart 1.5.x. Based on your statement of installing Edit Orders 2.x, it sounds like your store may have been upgraded "in-place" multiple times over the years. Over time this can result in lots of clutter, outdated files, and other issues. If this is the case with your site, it could be a contributing factor...

It may be in your best interest to start over with a clean install of the current version of Zen Cart 1.5.x (if the above is true). Once installed, start with a new template (designed for 1.5.x). Upgrade a "copy" of your old database and test. Only install Zen Cart plugins / modifications designed for 1.5.x (and required by your business needs). When done testing (and ensuring all required functionality works), deploy to the new site.

NOTE 1: I will not be responding further on this subject until answers to all of the questions listed in the "Posting Tips" have been supplied, answers to the questions asked in this thread have been supplied, and the response shows appropriate research (including reading the README, searching the forums, and applying known patches) has been completed.

NOTE 2: The appropriate place to change how individual order total modules operate is inside the order total modules themselves. Changes should not applied by editing the core loader / processing class "order_total.php".

21 Apr 2014, 12:34 AM
#515
burtonte avatar

burtonte

New Zenner

Join Date:
Apr 2014
Location:
texas
Posts:
3
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Ok sorry for the missing information. I have included the differences between the vanilla zencart 1.5.1 install and the edit_orders 4.1.4 install. The responses I received caused me to go back and research what I think to be the real issue. Thanks again for your responses...

includes/classes/order_total.php

function order_total() {
global $messageStack;
if (defined('MODULE_ORDER_TOTAL_INSTALLED') && zen_not_null(MODULE_ORDER_TOTAL_INSTALLED)) {
$module_list = explode(';', MODULE_ORDER_TOTAL_INSTALLED);

  reset($module_list);
  while (list(, $value) = each($module_list)) {
  	// Fixes for when called from ADMIN
  	$lang_file = null;

// edit_orders v4.1.4 has this here.. causes blank screen when add new order from admin
// $module_file = DIR_WS_MODULES . 'order_total/' . $value;

  	if(IS_ADMIN_FLAG === true) {
  		$lang_file = zen_get_file_directory(DIR_FS_CATALOG . DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/order_total/', $value, 'false');
  		$module_file = DIR_FS_CATALOG . $module_file;
  	}
    else {
    	$lang_file = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/order_total/', $value, 'false');
    }
    if (@file_exists($lang_file)) {
      include_once($lang_file);
    } else {
      if (IS_ADMIN_FLAG === false && is_object($messageStack)) {
        $messageStack->add('header', WARNING_COULD_NOT_LOCATE_LANG_FILE . $lang_file, 'caution');
      } else {
        $messageStack->add_session(WARNING_COULD_NOT_LOCATE_LANG_FILE . $lang_file, 'caution');
      }
    }

// Moved to original position from zen cart 1.5.1 install to make add new order work in admin
$module_file = DIR_WS_MODULES . 'order_total/' . $value;

    if (@file_exists($module_file)) {
      include_once($module_file);
      $class = substr($value, 0, strrpos($value, '.'));
      $GLOBALS[$class] = new $class;
      $this->modules[] = $value;
    }
  }
}

}

21 Apr 2014, 3:04 AM
#516
lhungil avatar

lhungil

Totally Zenned

Join Date:
Feb 2012
Location:
mostly harmless
Posts:
1,818
Plugin Contributions:
4

Re: Edit Orders v4.0 Support Thread

For anyone else reading this thread. Please disregard changes posted by burtonte.

In a properly configured store, moving that line will usually result in order total modules not loading from the admin interface. This includes "subtotal", "total", "tax", etc.

If order total modules are not loaded Edit Orders 4.1+ will not function correctly.

23 May 2014, 6:27 PM
#517
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

Does anyone have a copy of the plugin's v4.0.2 zip-file? I'm trying to "get a feeling" for the complexity of an upgrade to the most recent version.

25 May 2014, 3:14 PM
#518
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

FWIW, EO 4.1.4 installed without a hitch over the v4.0.2 "mystery version"!

I did, however, run into an issue that I'm not sure how to resolve:

SCENARIO: I've got an order total (a deduction) where the amount of the deduction is, essentially, dependent on the value of the cart/order. It uses the order-class structure to determine the overall order value and, if the order's total is less than some configurable value, then discount is not applied.

EO and my OT recalculate the deduction properly so long as the deduction doesn't change from a non-zero to a zero value! That's because, when the deduction is 0, the order-total class doesn't return that OT value as part of its modules. The order's subtotal, tax and total values are correct, it's just that the now-zero deduction doesn't get removed from the order's totals.

Any guidance would be much appreciated.

25 May 2014, 3:51 PM
#519
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Edit Orders v4.0 Support Thread

FWIW, here's how I corrected my issue (/YOUR_ADMIN/includes/functions/extra_functions/edit_orders_functions.php):

function eo_update_database_order_totals($oID) {
	global $db, $order;

	// Load required modules for order totals if enabled
	if(defined('MODULE_ORDER_TOTAL_INSTALLED') && zen_not_null(MODULE_ORDER_TOTAL_INSTALLED)) {

		// Load order totals.
		require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'order_total.php');
		$GLOBALS['order_total_modules'] = new order_total();

		// Load the shopping cart class into the session
		eo_shopping_cart();

		// This fixes an issue caused by ot_shipping assuming shipping tax amount
		// has not already been added to the shipping cost and order tax.
		if(array_key_exists('shipping_tax', $order->info)) {
			$order->info['tax'] -= $order->info['shipping_tax'];
			if (DISPLAY_PRICE_WITH_TAX == 'true') $order->info['shipping_cost'] -= $order->info['shipping_tax'];
		}

		// Reset the final total (include tax if not already tax-inc)
		// This code causes the order totals to be correctly calculated.
		if (DISPLAY_PRICE_WITH_TAX == 'true') {
			$order->info['total'] = $order->info['subtotal'] + $order->info['shipping_cost'];
		} else {
			$order->info['total'] = $order->info['subtotal'] + $order->info['tax'] + $order->info['shipping_cost'];
		}

		// Process the order totals
		$order_totals = $GLOBALS['order_total_modules']->process();

		// Update the order totals in the database
		for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
			eo_update_database_order_total($oID, $order_totals[$i]);
		}
//-BOF-lat9-account for order total modules that have been removed
    if (count ($order->totals) > $n) {
      for ($i=0, $totals_titles = array (); $i<$n; $i++) {
        $totals_titles[] = $order_totals[$i]['title'];
      }
      for ($i=0, $n=count($order->totals); $i<$n; $i++) {
        if (!in_array ($order->totals[$i]['title'], $totals_titles)) {
          $db->Execute ("DELETE FROM " . TABLE_ORDERS_TOTAL . " WHERE orders_id = $oID AND title = '" . zen_db_input ($order->totals[$i]['title']) . "' LIMIT 1");
        }
      }
      unset ($totals_titles);
    }
//-EOF-lat9
		unset($order_totals);
	}
}
30 May 2014, 4:07 AM
#520
bbsbcastle avatar

bbsbcastle

New Zenner

Join Date:
Aug 2009
Location:
Greeneville, TN USA
Posts:
55
Plugin Contributions:
0

Re: Edit Orders v4.0 Support Thread

Hello,

I'm running a fresh install of ZenCart v1.5.1 and Edit Orders 4.1.4.

I've searched the threads and installation document and don't see the answer to this.

Is this compatible with "Fast and Easy Checkout". Are there any issues I need to consider before installing it?

Thanks