For those getting the "PHP Fatal error: Pre-existing zen_get_tax_locations function detected" error, I did the following two changes as a TEMPORARY FIX and it worked for me. You may want to give it a shot but use at your own risk. Again, this worked for me and allowed me to EDIT an order and ADD an item to it.
1. I completely removed the Lines 297 thru 343 in admin/includes/functions/extra_functions/edit_orders_functions.php. Specifically, this section was completely removed:
Code:
if (function_exists ('zen_get_tax_locations')) {
trigger_error ('Pre-existing zen_get_tax_locations function detected.', E_USER_ERROR);
exit ();
} else {
function zen_get_tax_locations($store_country = -1, $store_zone = -1) {
global $order;
if (STORE_PRODUCT_TAX_BASIS == 'Store') {
$GLOBALS['customer_country_id'] = STORE_COUNTRY;
$GLOBALS['customer_zone_id'] = STORE_ZONE;
} else {
$_SESSION['customer_id'] = $order->customer['id'];
if (STORE_PRODUCT_TAX_BASIS == 'Shipping') {
global $eo;
if ($eo->eoOrderIsVirtual ($GLOBALS['order'])) {
if (is_array ($GLOBALS['order']->billing['country'])) {
$GLOBALS['customer_country_id'] = $GLOBALS['order']->billing['country']['id'];
} else {
$GLOBALS['customer_country_id'] = zen_get_country_id ($GLOBALS['order']->billing['country']);
}
$GLOBALS['customer_zone_id'] = zen_get_zone_id ($GLOBALS['customer_country_id'], $GLOBALS['order']->billing['state']);
} else {
if (is_array ($GLOBALS['order']->delivery['country'])) {
$GLOBALS['customer_country_id'] = $GLOBALS['order']->delivery['country']['id'];
} else {
$GLOBALS['customer_country_id'] = zen_get_country_id ($GLOBALS['order']->delivery['country']);
}
$GLOBALS['customer_zone_id'] = zen_get_zone_id ($GLOBALS['customer_country_id'], $GLOBALS['order']->delivery['state']);
}
} elseif (STORE_PRODUCT_TAX_BASIS == 'Billing') {
if (is_array ($GLOBALS['order']->billing['country'])) {
$GLOBALS['customer_country_id'] = $GLOBALS['order']->billing['country']['id'];
} else {
$GLOBALS['customer_country_id'] = zen_get_country_id ($GLOBALS['order']->billing['country']);
}
$GLOBALS['customer_zone_id'] = zen_get_zone_id ($GLOBALS['customer_country_id'], $GLOBALS['order']->billing['state']);
}
}
$_SESSION['customer_country_id'] = $GLOBALS['customer_country_id'];
$_SESSION['customer_zone_id'] = $GLOBALS['customer_zone_id'];
return [
'zone_id' => $GLOBALS['customer_zone_id'],
'country_id' => $GLOBALS['customer_country_id']
];
}
}
2. I also added the following EDIT on Line 16 of admin/includes/modules/edit_orders/eo_edit_action_display.php.
I put word "lang." after the "/modules/payment/" in order to account for the new naming convention for language files:
Code:
require DIR_FS_CATALOG_LANGUAGES . $_SESSION['language'] . '/modules/payment/lang.' . $order->info['payment_module_code'] . '.php';
After that, I was able to successfully edit my order to my needs. Might not be the best "solution" which could possibly break something else in the plugin, but it worked for me.