1
Hi,
I am trying to get the osCommerce module working sitewide, so that the shop blocks can be used anywhere on the site.
I need to define a function but can't figure out if I need to use the (Xoops) header.php or index.php.
The error:
Fatal error: Call to undefined function: tep_random_select() in /home/.sites/109/site189/web/modules/shop/blocks/specials.php on line 8
The code to resolve this error: (can be wrong)
// the following cPath references come from application_top.php
$category_depth = 'top';
if (isset($cPath) && tep_not_null($cPath)) {
$categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
$cateqories_products = tep_db_fetch_array($categories_products_query);
if ($cateqories_products['total'] > 0) {
$category_depth = 'products'; // display products
} else {
$category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
$category_parent = tep_db_fetch_array($category_parent_query);
if ($category_parent['total'] > 0) {
$category_depth = 'nested'; // navigate through the categories
} else {
$category_depth = 'products'; // category has no products, but display the 'no products' message
}
}
}
Thanks in advance,
Fred