Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fatal Error: Cannot Redeclare Tep_show_category()


Snoboreders

Recommended Posts

Posted

Ok, here is the error I received after properly installing(getting it to work in the admin section) botht he UPSXML_v1_2_8_1_2 (checkout_shipping.php) and paypal_express_checkout_IPN_v0.4.1 (checkout_payment.php). Clearly both the amended files that I replace the default checkout_shipping and _payment.php files calls something that the default does not.

 

Is it possible to remove the code from header.php without it affecting the site, or perhaps categories.php...or, should I try to remove it from those amended files? Here is my header.php file from line 145

</body>

Fatal error: Cannot redeclare tep_show_category() (previously declared in /home/content/N/o/x/Noxwear/html/includes/header.php:147) in /home/content/N/o/x/Noxwear/html/includes/boxes/categories.php on line 13

<?   // ---- CATEGORIES

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

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

$categories_string .= $categories_string ? '<tr><td><img src=images/m18.gif width=125 height=1></td></tr><tr><td height=4></td></tr>' : '';			 

$categories_string .= '<tr><td>    <img src=images/m06.gif width=4 height=4 align=absmiddle>   <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 category name

 

This I believe is pretty standard. Here is my code in my includes/boxes/categories.php file lines 13-34:

  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

 

 

Hopefully somebody has had this problem before, but if need be, I can post the code for those files that came with the module. I truly appreciate any assistance.

 

-Chris

Archived

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

×
×
  • Create New...