Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Left Column (Categories infox) disappeared


militarytour

Recommended Posts

I was doing minor changes to the index.php page and for some strange reason my left column along with the categories and site links box completely disappeared.

 

I need to re-add this.

 

Anyone can offer me pointers to reinstate the left column with missing infoboxes.

 

Thank you

Link to comment
Share on other sites

I was doing minor changes to the index.php page and for some strange reason my left column along with the categories and site links box completely disappeared.

 

I need to re-add this.

 

Anyone can offer me pointers to reinstate the left column with missing infoboxes.

 

Thank you

 

Firstly you should alwasy backup any file you intend to edit no matter how simple the edit then you can easily undo the error.

 

Look in index.php around line 48 for the code

 

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->

 

Some of that should be there see what isn't and replace it with the above

Link to comment
Share on other sites

Hey thanks for the tip but now I get some fatal error.

 

This is what pops up:

 

Fatal error: Call to undefined function: tep_show_category() in ******/***********/*******/*******/includes/boxes/categories.php on line 131

 

Any clue?

 

Thanks for yoour time

Link to comment
Share on other sites

Hey thanks for the tip but now I get some fatal error.

 

This is what pops up:

 

Fatal error: Call to undefined function: tep_show_category() in ******/***********/*******/*******/includes/boxes/categories.php on line 131

 

Any clue?

 

Thanks for yoour time

 

You seem to have an error in the category box file the function tep_show_category should be defined in the includes/boxes/categories.php as the first bit of code this is then called later in line 131. Look for the code below at the top of your page and if it's now there add it agter the original comments and before

<tr>

<td>

<?php

$info_box_contents = array();

 

  function tep_show_category($counter) {
global $tree, $categories_string, $cPath_array;

for ($i=0; $i<$tree[$counter]['level']; $i++) {
  $categories_string .= "  ";
}

$categories_string .= '<a href="';

if ($tree[$counter]['parent'] == 0) {
  $cPath_new = 'cPath=' . $counter;
} else {
  $cPath_new = 'cPath=' . $tree[$counter]['path'];
}

$categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';

if (isset($cPath_array) && in_array($counter, $cPath_array)) {
  $categories_string .= '<b>';
}

// display category name
$categories_string .= $tree[$counter]['name'];

if (isset($cPath_array) && in_array($counter, $cPath_array)) {
  $categories_string .= '</b>';
}

if (tep_has_category_subcategories($counter)) {
  $categories_string .= '->';
}

$categories_string .= '</a>';

if (SHOW_COUNTS == 'true') {
  $products_in_category = tep_count_products_in_category($counter);
  if ($products_in_category > 0) {
	$categories_string .= ' (' . $products_in_category . ')';
  }
}

$categories_string .= '<br>';

if ($tree[$counter]['next_id'] != false) {
  tep_show_category($tree[$counter]['next_id']);
}
 }
?>
<!-- categories //-->

Link to comment
Share on other sites

Thanks again.

 

I added this code to the categories.php file and still I see no left column with categories on the mainpage. Wondering if it's in my index.php file.

 

<tr>

<td>

<?php

$info_box_contents = array();

 

function tep_show_category($counter) {

global $tree, $categories_string, $cPath_array;

 

for ($i=0; $i<$tree[$counter]['level']; $i++) {

$categories_string .= " ";

}

 

$categories_string .= '<a href="';

 

if ($tree[$counter]['parent'] == 0) {

$cPath_new = 'cPath=' . $counter;

} else {

$cPath_new = 'cPath=' . $tree[$counter]['path'];

}

 

$categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';

 

if (isset($cPath_array) && in_array($counter, $cPath_array)) {

$categories_string .= '<b>';

}

 

// display category name

$categories_string .= $tree[$counter]['name'];

 

if (isset($cPath_array) && in_array($counter, $cPath_array)) {

$categories_string .= '</b>';

}

 

if (tep_has_category_subcategories($counter)) {

$categories_string .= '->';

}

 

$categories_string .= '</a>';

 

if (SHOW_COUNTS == 'true') {

$products_in_category = tep_count_products_in_category($counter);

if ($products_in_category > 0) {

$categories_string .= ' (' . $products_in_category . ')';

}

}

 

$categories_string .= '<br>';

 

if ($tree[$counter]['next_id'] != false) {

tep_show_category($tree[$counter]['next_id']);

}

}

 

?>

<!-- categories //-->

 

Thanks again your help is greatly appreciated

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...