Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

URGENT: error in clients shop


jpmad4it

Recommended Posts

Hey guys,

 

I have a problem with a clients shop, when clicking on 'checkout' I am getting this error:

 

Fatal error: Cannot redeclare tep_show_category() (previously declared in /home/boogaloobaby/public_html/includes/header.php:185) in /home/boogaloobaby/public_html/includes/boxes/categories.php on line 13

 

I have no idea what this means - can anyone help me out please? What does it mean, can it be fixed :huh:

 

Thanks for help in advance

 

Jp

Link to comment
Share on other sites

Hey guys,

 

I have a problem with a clients shop, when clicking on 'checkout' I am getting this error:

 

Fatal error: Cannot redeclare tep_show_category() (previously declared in /home/boogaloobaby/public_html/includes/header.php:185) in /home/boogaloobaby/public_html/includes/boxes/categories.php on line 13

 

I have no idea what this means - can anyone help me out please? What does it mean, can it be fixed :huh:

 

Thanks for help in advance

 

Jp

 

Anyone at all? Or am i going to have to reinstall the cart? :'(

Link to comment
Share on other sites

Anyone at all? Or am i going to have to reinstall the cart? :'(

 

Can show the contents of this file "in /home/boogaloobaby/public_html/includes/header.php:185)"?

Link to comment
Share on other sites

Can show the contents of this file "in /home/boogaloobaby/public_html/includes/header.php:185)"?

 

Hey thanks.........Sure - here you go:

 

<?php
/*
 $Id: header.php,v 1.42 2003/06/10 18:20:38 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

// check if the 'install' directory exists, and warn of its existence
 if (WARN_INSTALL_EXISTENCE == 'true') {
if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) {
  $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning');
}
 }

// check if the configure.php file is writeable
 if (WARN_CONFIG_WRITEABLE == 'true') {
if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) {
  $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning');
}
 }

// check if the session folder is writeable
 if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') {
if (STORE_SESSIONS == '') {
  if (!is_dir(tep_session_save_path())) {
	$messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning');
  } elseif (!is_writeable(tep_session_save_path())) {
	$messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning');
  }
}
 }

// check session.auto_start is disabled
 if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) {
if (ini_get('session.auto_start') == '1') {
  $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning');
}
 }

 if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) {
if (!is_dir(DIR_FS_DOWNLOAD)) {
  $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning');
}
 }

 if ($messageStack->size('header') > 0) {
echo $messageStack->output('header');
 }
?>
<!--






-->


 <table cellspacing=0 cellpadding=0 width=713 height=100% align=center>
  <tr><td valign=top>
<table cellspacing=0 cellpadding=0>
 <tr><td>
  <table cellspacing=0 cellpadding=0>
   <tr><td width=373><a href=<?=tep_href_link('index.php')?>><img src=images/m01.gif width=267 height=82 border=0></a></td>
   <td width=340 valign=top>
	<table cellspacing=0 cellpadding=0>
	 <tr><td height=44></td></tr>	
	 <tr><td width=344 bgcolor=#F4F0ED height=36>
	  <table cellspacing=0 cellpadding=0>
	   <tr><td style="padding-left: 62px"><a href=<?=tep_href_link('shopping_cart.php')?>><img src=images/m03.gif width=15 height=17 align=absmiddle border=0></a> <span class=ch1>Shopping Cart</span> <span class=ch2>now in your cart</span> <a class=ml5 href=<?=tep_href_link('shopping_cart.php')?>><?=$cart->count_contents()?> items</a></td></tr>
	  </table>
	 </td></tr>
	</table>  
   </td></tr> 
  </table>
 </td></tr>
 <tr><td>
  <table cellspacing=0 cellpadding=0>
   <tr><td>
	<table cellspacing=0 cellpadding=0>
	 <tr><td><img src=images/m04.gif width=215 height=38></td></tr> 
	 <tr><td><a href=<?=tep_href_link('index.php')?>><img src=images/b01.gif width=215 height=30 border=0></a></td></tr>
	 <tr><td><a href=<?=tep_href_link('products_new.php')?>><img src=images/b02.gif width=215 height=30 border=0></a></td></tr>
	 <tr><td><a href=<?=tep_href_link('account.php')?>><img src=images/b03.gif width=215 height=32 border=0></a></td></tr>
	 <tr><td><a href=<?=tep_href_link('shopping_cart.php')?>><img src=images/b04.gif width=215 height=33 border=0></a></td></tr>
	 <tr><td><a href=<?=tep_href_link('checkout_shipping.php')?>><img src=images/b05.gif width=215 height=30 border=0></a></td></tr>
	 <tr><td><img src=images/m05.gif width=215 height=33></td></tr> 
	</table>  
   </td>
   <td><img src=images/m06.jpg width=206 width=226><img src=images/m07.jpg width=292 height=226 border=0></a></td></tr>  
  </table> 
 </td></tr>
 <tr><td>
  <table cellspacing=0 cellpadding=0>
   <tr><td width=215 valign=top>
	<table cellspacing=0 cellpadding=0 width=215>
	 <tr><td height=1></td></tr>
	 <tr><td bgcolor=#67C0E3 height=30 align=center>
	  <table cellspacing=0 cellpadding=0>
	   <tr><td width=68 class=ch3>Currencies:</td>
	   <td>
<? // CURRENCIES

echo tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get');

reset($currencies->currencies);
$currencies_array = array();
while (list($key, $value) = each($currencies->currencies)) {
  $currencies_array[] = array('id' => $key, 'text' => $value['title']);
}

$hidden_get_variables = '';
reset($HTTP_GET_VARS);
while (list($key, $value) = each($HTTP_GET_VARS)) {
  if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) {
	$hidden_get_variables .= tep_draw_hidden_field($key, $value);
  }
}

echo tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit(); "class=se" style="width:100px"') . $hidden_get_variables . tep_hide_session_id();
echo '</form>';

?>			   

	  </td></tr>
	  </table> 
	 </td></tr>
	</table>
   </td>
   <td><img src=images/m08.jpg></td>
   <td width=292>
	<table cellspacing=0 cellpadding=0 width=292>
	 <tr><td height=1></td></tr>
	 <tr><td bgcolor=#67C0E3 height=30>
	  <table cellspacing=0 cellpadding=0>
	   <tr><td width=37></td>
	   <td width=1 heigth=20 bgcolor=#B0DEF0></td>
	   <td width=136 class=ch3 style="padding-left: 18px">Choose your language:</td>
	   <td>
<? // LANGUAGES

 if (!isset($lng) || (isset($lng) && !is_object($lng))) {
include(DIR_WS_CLASSES . 'language.php');
$lng = new language;
 }

 $languages_string = '';
 reset($lng->catalog_languages);
 while (list($key, $value) = each($lng->catalog_languages)) {
$languages_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES .  $value['directory'] . '/images/' . $value['image'], $value['name']) . '</a> ';
 }

 echo $languages_string;

?>	 

	 </td></tr>
	  </table> 
	 </td></tr>
	</table>
   </td></tr>
  </table>  
 </td></tr>
 <tr><td height=1></td></tr>
</table>
  </td></tr> 
  <tr><td height=100% valign=top>
<table cellspacing=0 cellpadding=0>
 <tr><td width=197 style="padding-right: 1px" valign=top>
  <table cellspacing=0 cellpadding=0 width=197>
   <tr><td bgcolor=#EAA000 width=197 height=28><img src=images/m13.gif width=31 height=28 align=absmiddle><span style="padding-left: 7px"></span><span class=ch4>Shop by categories</span></td></tr>  
   <tr><td height=1></td></tr>
   <tr><td>
	<table cellspacing=0 cellpadding=0 width=197>


<?   // ---- CATEGORIES

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

  if(!$tree[$counter]['level']){			   

$categories_string .= $categories_string ? '<tr><td height=1></td></tr>' : '';			 

$categories_string .= '
	 <tr><td bgcolor=#E9DDC4 width=22 height=19 align=center><img src=images/m14.gif></td>
	 <td bgcolor=#F5F0E4 width=175><span class=ch5></span><a class=ml2 href=
					  ';

if ($tree[$counter]['parent'] == 0) {
  $cPath_new = 'cPath=' . $counter;
} else {
  $cPath_new = 'cPath=' . $tree[$counter]['path'];
}
$categories_string .= tep_href_link('index.php', $cPath_new) . '>';
// display categry name
$categories_string .= $tree[$counter]['name'];
$categories_string .= '</a></td></tr> ';

  }else{  // SUBCATEGORY

$categories_string .= '
	 <tr><td bgcolor=#E9DDC4 width=22 height=19 align=center><img src=images/m14.gif></td>
	 <td bgcolor=#F5F0E4 width=175><span class=ch5></span>
		   ';

for($i=0;$i<$tree[$counter]['le vel'];$i++)
 $categories_string .= '     ';

$categories_string .= '     <a class=ml2 style="font-weight:normal;" href=';   
if ($tree[$counter]['parent'] == 0) {
  $cPath_new = 'cPath=' . $counter;
} else {
  $cPath_new = 'cPath=' . $tree[$counter]['path'];
}
$categories_string .= tep_href_link('index.php', $cPath_new) . '>-';
// display category name
$categories_string .= $tree[$counter]['name'];
$categories_string .= '</a></td></tr>';
  }  

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



 define(TABLE_CATEGORIES, "categories");
 define(TABLE_CATEGORIES_DESCRIPTION, "categories_description");
 $categories_string = '';
 $tree = array();

 $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
 while ($categories = tep_db_fetch_array($categories_query))  {
$tree[$categories['categories_id']] = array('name' => $categories['categories_name'],
											'parent' => $categories['parent_id'],
											'level' => 0,
											'path' => $categories['categories_id'],
											'next_id' => false);

if (isset($parent_id)) {
  $tree[$parent_id]['next_id'] = $categories['categories_id'];
}

$parent_id = $categories['categories_id'];

if (!isset($first_element)) {
  $first_element = $categories['categories_id'];
}
 }

 //------------------------
 if ($cPath) {
$new_path = '';
reset($cPath_array);
while (list($key, $value) = each($cPath_array)) {
  unset($parent_id);
  unset($first_id);
  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$value . "' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
  if (tep_db_num_rows($categories_query)) {
	$new_path .= $value;
	while ($row = tep_db_fetch_array($categories_query)) {
	  $tree[$row['categories_id']] = array('name' => $row['categories_name'],
										   'parent' => $row['parent_id'],
										   'level' => $key+1,
										   'path' => $new_path . '_' . $row['categories_id'],
										   'next_id' => false);

	  if (isset($parent_id)) {
		$tree[$parent_id]['next_id'] = $row['categories_id'];
	  }

	  $parent_id = $row['categories_id'];

	  if (!isset($first_id)) {
		$first_id = $row['categories_id'];
	  }

	  $last_id = $row['categories_id'];
	}
	$tree[$last_id]['next_id'] = $tree[$value]['next_id'];
	$tree[$value]['next_id'] = $first_id;
	$new_path .= '_';
  } else {
	break;
  }
}
 }
 $categories_string .=  '';
 tep_show_category($first_element); 
 $categories_string .=  '';

 echo $categories_string;
?>

	 <tr><td height=1></td></tr>
	</table>  
   </td></tr>


   <tr><td bgcolor=#EAA000 width=197 height=28><img src=images/m13.gif width=31 height=28 align=absmiddle><span style="padding-left: 7px"></span><span class=ch4>Best sellers</span></td></tr>  
   <tr><td height=1></td></tr>
   <tr><td>
	  <table cellspacing=0 cellpadding=0 width=197>


<?   // ---- Bestsellers

 $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_ordered desc, pd.products_name limit " . 10);
 if ($number_of_rows = tep_db_num_rows($best_sellers_query)) {

  $best_array = array();
  while ($bestseller = tep_db_fetch_array($best_sellers_query)) {
	$output_1 .= $output ? '<tr><td height=1></td></tr>' : '';			 
	$output_1 .= '
	 <tr><td bgcolor=#E9DDC4 width=22 height=19 align=center><img src=images/m14.gif></td>
	 <td bgcolor=#F5F0E4 width=175><span class=ch5></span><a class=ml2 href=';
	$products_name = ((strlen($bestseller['products_name']) > 25) ? substr($bestseller['products_name'], 0, 25) . '..' : $bestseller['products_name']);
	$output_1 .= tep_href_link('product_info.php', 'products_id='.$bestseller['products_id']). '>'.$products_name;
	$output_1 .= '</a></td></tr>';
  }

echo $output_1;
 }

?>





	 <tr><td height=1></td></tr>
	</table>  
   </td></tr>
   <tr><td bgcolor=#5B5B5B width=197 height=28><img src=images/m15.gif align=absmiddle><span style="padding-left: 7px"></span><span class=ch4>Site search</span></td></tr>  
   <tr><td height=1></td></tr>
   <tr><td bgcolor=#CDCDCD height=32 align=cetner>
<? // SEARCH ?> 
<table cellspacing=0 cellpadding=0 align=center>
	<?=tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get')?>
   <tr><td width=140>
	 <?=tep_draw_input_field('keywords', '', 'size="20" maxlength="50"	onclick="this.value=\'\'" value="keyword"   class=se2 ') . ' ' . tep_hide_session_id()?></td><td><input type=image src=images/m16.gif></td></tr>
	  </form>
	  </table>
<? // END SEARCH ?>


   </td></tr>
   <tr><td height=8></td></tr>
   <tr><td style="padding-left: 5px"><img src=images/m17.gif width=181 height=26></td></tr>
   <tr><td height=4></td></tr>
  </table> 
 </td>
 <td width=515 valign=top>

Link to comment
Share on other sites

oh issit you have additions to your end of your header.php file?

 

 

Sorry yeah I should have mentioned - this is a template that was purchased i.e. it has already been modified upon purchase. I then added the Options as Images MS2 contribution. Can you see an error??

Link to comment
Share on other sites

Hi,

**Pls do backup before makeing the below changes.**

 

I am not too sure, but can u try changing all occurance of "tep_show_category" to "tep_show_category1" in the categories.php file.

Link to comment
Share on other sites

Hi,

**Pls do backup before makeing the below changes.**

 

I am not too sure, but can u try changing all occurance of "tep_show_category" to "tep_show_category1" in the categories.php file.

 

 

hey there, that worked - superstar !! BUT....there's always a but <_< In the checkout shipping page the full left hand column of the standard Oscommerce template (that is the one that holds categories, manufacturers list, featured product, search and Shipping & Returns Privacy Notice, Conditions of Use,Contact Us) is being displayed randomly and it shouldn't be. Whoever made the template took this part out originally. Any ideas?

Link to comment
Share on other sites

hey there, that worked - superstar !! BUT....there's always a but <_< In the checkout shipping page the full left hand column of the standard Oscommerce template (that is the one that holds categories, manufacturers list, featured product, search and Shipping & Returns Privacy Notice, Conditions of Use,Contact Us) is being displayed randomly and it shouldn't be. Whoever made the template took this part out originally. Any ideas?

 

What do u mean by "is being displayed randomly and it shouldn't be"?

Link to comment
Share on other sites

What do u mean by "is being displayed randomly and it shouldn't be"?

 

The best way to show you is via a screenshot I think:

 

cart.jpg

 

The left hand column shouldn't be there, and neither should the 'whats in my cart' box to the right of the centre content.

 

Only the centre content should be displayed - delivery information

Link to comment
Share on other sites

Hi jpmad4it,

I think, this needs quite a major modification to the codes. I think its better u get they guys who did it for u to come change it back. :rolleyes:

Link to comment
Share on other sites

Hi jpmad4it,

I think, this needs quite a major modification to the codes. I think its better u get they guys who did it for u to come change it back. :rolleyes:

 

 

oh dear >_< noooooooo

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...