1
Drexel
Where to put the code?
  • 2005/7/18 11:53

  • Drexel

  • Just popping in

  • Posts: 13

  • Since: 2005/3/8 0


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

Login

Who's Online

166 user(s) are online (108 user(s) are browsing Support Forums)


Members: 0


Guests: 166


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits