Originally Posted by
CarolineBogart
Hello zenniac seo url'ers,
I have updated zen to 1.5.7c today, and have noticed that it broke usu.php in admin/includes/functions/extra_functions/usu.php
That file invokes a call to zen_product_in_parent_category(), but this does not exist in its paths.
I had to add it to usu.php (and moved it to general.php) to make the categories/products area work in the admin.
Did I perhaps miss an updatee to admin general.php that defined this function for usu.php to call?
That's a function that is/was missing from the Zen Cart V1.5.7 includes/functions/functions_categories.php.
https://github.com/zencart/zencart/b....php#L231-L258
Code:
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;
}
Bookmarks