Re: Edit Orders v4.0 Support Thread
bug in the code. lines 1025-1028 in the function eo_remove_product_from_order. i have shown my correction (although there are other possibilities):
PHP Code:
// original code
$check = $db->Execute(
'SELECT `p`.`products_quantity` FROM `' . TABLE_PRODUCTS . '` ' .
'WHERE `p`.`products_id` = \'' . (int)$query->fields['products_id'] . '\''
);
// correction
$check = $db->Execute(
'SELECT `p`.`products_quantity` FROM `' . TABLE_PRODUCTS . '` p ' .
'WHERE `p`.`products_id` = \'' . (int)$query->fields['products_id'] . '\''
);
best.
Re: Edit Orders v4.0 Support Thread
Re: Edit Orders v4.0 Support Thread
This one, on the other hand, just cropped up recently on a client's site when he was editing an order with a restricted coupon:
Code:
PHP Fatal error: Call to undefined function zen_product_in_category() in /home/mysite/public_html/admin/includes/functions/extra_functions/edit_orders_functions.php on line 326
The line number's most likely not going to match because I've kept this site up-to-date with the EO bug-fixes as they're reported. To correct the issue, I edited /admin/includes/functions/extra_functions/edit_orders_functions.php, conditionally adding the function defined in the store-front's /includes/functions/functions_categories.php as highlighted below:
Code:
//-bof-20160128-lat9-Forum bugfix
if (!function_exists ('zen_product_in_category')) {
function zen_product_in_category($product_id, $cat_id) {
global $db;
$in_cat=false;
$category_query_raw = "select categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . "
where products_id = '" . (int)$product_id . "'";
$category = $db->Execute($category_query_raw);
while (!$category->EOF) {
if ($category->fields['categories_id'] == $cat_id) $in_cat = true;
if (!$in_cat) {
$parent_categories_query = "select parent_id from " . TABLE_CATEGORIES . "
where categories_id = '" . $category->fields['categories_id'] . "'";
$parent_categories = $db->Execute($parent_categories_query);
//echo 'cat='.$category->fields['categories_id'].'#'. $cat_id;
while (!$parent_categories->EOF) {
if (($parent_categories->fields['parent_id'] !=0) ) {
if (!$in_cat) $in_cat = zen_product_in_parent_category($product_id, $cat_id, $parent_categories->fields['parent_id']);
}
$parent_categories->MoveNext();
}
}
$category->MoveNext();
}
return $in_cat;
}
}
//-eof-20160128-lat9
// Start Edit Orders configuration functions
function eo_debug_action_level_list($level) {
global $template;
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lat9
This one, on the other hand, just cropped up recently on a client's site when he was editing an order with a restricted coupon ...
Good Eye, should be applied along with the patches here. May also have to include zen_product_in_parent_category from "/includes/functions/functions_categories.php".
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lhungil
Good Eye, should be applied along with the patches
here. May also have to include zen_product_in_parent_category from "/includes/functions/functions_categories.php".
Good eye back at you, lhungil. I totally missed that one.
Re: Edit Orders v4.0 Support Thread
I'm using the mod Big Chooser by That Software Guy and can't get it to work with this mod. When I upload the orders.php file that comes with this mod, I get the same warning everyone else does about the shipping address (because 99.9% of my products are virtual), so I would like to have that removed. But when I click update, I get a 500 server error. Checking my logs, this is the error I get:
[29-Jan-2016 18:51:21 America/New_York] PHP Warning: array_key_exists() expects parameter 2 to be array, boolean given in /includes/functions/extra_functions/edit_orders_functions.php on line 1409
[29-Jan-2016 18:51:21 America/New_York] PHP Warning: array_key_exists() expects parameter 2 to be array, boolean given in /includes/functions/extra_functions/edit_orders_functions.php on line 1409
[29-Jan-2016 18:51:21 America/New_York] PHP Fatal error: Call to undefined function zen_get_products_manufacturers_id() in /includes/modules/order_total/ot_big_chooser.php on line 942
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lat9
sorry. did not see it....
on another note, i am hopeful that in future releases, the admin of ZC makes use of the customer facing functions and then starts extending/adding as opposed to re-creating and having the ame code in 2 places... although some times the functions are slightly different which in my mind only makes matters worse.
best.
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
carlwhat
sorry. did not see it....
on another note, i am hopeful that in future releases, the admin of ZC makes use of the customer facing functions and then starts extending/adding as opposed to re-creating and having the ame code in 2 places... although some times the functions are slightly different which in my mind only makes matters worse.
best.
<off-topic>
Agreed on the combined use of functions on the admin/store-front! It's got to be a pain to the developers, too, since they need to maintain two versions of most of the functions.
</off-topic>
Re: Edit Orders v4.0 Support Thread
Quote:
Originally Posted by
lat9
<off-topic>
Agreed on the combined use of functions on the admin/store-front!
It's got to be a pain to the developers, too, since they need to maintain two versions of most of the functions.
</off-topic>
Yup. There's been some work in the upcoming v1.6.0 to consolidate some of the duplication. It's not perfect, but it's progressively improving over time.
Re: Edit Orders v4.0 Support Thread
Apologies if this has been previously reported, but if Edit Orders is used to add a multi-line comment, the comments are "over-prepared" as described in this (https://www.zen-cart.com/showthread....94#post1303394) posting, i.e. the comments display as
Code:
line 1\r\nline2\r\n
instead of
That posting also contains the corrective action.