我安装了最新版本的 OSCommerce 框架。在后端类别/产品错误中显示如下:
警告:sizeof():参数必须是在 C:\xampp\htdocs\oscommerce\catalog\admin\includes\functions\general.php 第 93 行中实现 Countable 的数组或对象
我尝试使用is_array()
但count()
仍然无法正常工作,下面是代码
function tep_get_path($current_category_id = '') {
global $cPath_array;
if ($current_category_id == '') {
$cPath_new = implode('_', $cPath_array);
} else {
if (sizeof($cPath_array) == 0) {
$cPath_new = $current_category_id;
} else {
$cPath_new = '';
$last_category_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where
categories_id = '" . (int)$cPath_array[(sizeof($cPath_array)-1)] . "'");
$last_category = tep_db_fetch_array($last_category_query);
$current_category_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where
categories_id = '" . (int)$current_category_id . "'");
$current_category = tep_db_fetch_array($current_category_query);
if ($last_category['parent_id'] == $current_category['parent_id']) {
for ($i = 0, $n = sizeof($cPath_array) - 1; $i < $n; $i++) {
$cPath_new .= '_' . $cPath_array[$i];
}
} else {
for ($i = 0, $n = sizeof($cPath_array); $i < $n; $i++) {
$cPath_new .= '_' . $cPath_array[$i];
}
}
$cPath_new .= '_' . $current_category_id;
if (substr($cPath_new, 0, 1) == '_') {
$cPath_new = substr($cPath_new, 1);
}
}
}
return 'cPath=' . $cPath_new;
}
慕丝7291255
精慕HU
慕工程0101907