Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Hi,

 

I have OSC vers earlier than oscommerce 2.2rc2a.

 

I attempted to add a product and received this error:

 

Fatal error: Call to undefined function: tep_output_generated_category_path_fs() in /home/content/t/e/c/techmania/html/catalog/admin/categories.php on line

351

 

The line looks like this:

 

// EOF Categories and Products Images Folder Tree

$prod_path = $HTTP_GET_VARS['cPath'];

$lchar = strrpos($prod_path, '_');

if ($lchar + 1 == 1) {

$lachar = 0;

} else {

$lachar = $lchar + 1;

}

$prod_path_id = substr($prod_path, $lachar);

$prod_folder = tep_output_generated_category_path_fs($prod_path_id);

$products_image->set_destination(DIR_FS_CATALOG_IMAGES . $prod_folder);

// EOF Categories and Products Images Folder Tree

if ($products_image->parse() && $products_image->save()) {

 

$products_image_name = $products_image->filename;

// BOF Categories and Products Images Folder Tree

 

 

Any idea how to resolve?

 

Thanks

Posted

admin/includes/functions/general.php

add the following at the end of the file before the closing ?>

 

// BOF Categories and Products Images Folder Tree
 function tep_output_generated_category_path_fs($id, $from = 'category') {
   $calculated_category_path_string = '';
   $calculated_category_path = tep_generate_category_path($id, $from);
   for ($i=0, $n=sizeof($calculated_category_path); $i<$n; $i++) {
         $ii = ($n - 1) - $i;
     for ($j=0, $k=sizeof($calculated_category_path[$ii]); $j<$k; $j++) {
         $jj = ($k - 1) - $j;
       $dir_path = ereg_replace("[^a-z0-9._]", "", str_replace(" ", "_", str_replace("%20", "_", strtolower($calculated_category_path[$ii][$jj]['text']))));
       $calculated_category_string .= $dir_path . '/';		
     }
   }
   return $calculated_category_string;
 }
// EOF Categories and Products Images Folder Tree

Part of this contribution

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted
admin/includes/functions/general.php

add the following at the end of the file before the closing ?>

 

// BOF Categories and Products Images Folder Tree
 function tep_output_generated_category_path_fs($id, $from = 'category') {
   $calculated_category_path_string = '';
   $calculated_category_path = tep_generate_category_path($id, $from);
   for ($i=0, $n=sizeof($calculated_category_path); $i<$n; $i++) {
         $ii = ($n - 1) - $i;
     for ($j=0, $k=sizeof($calculated_category_path[$ii]); $j<$k; $j++) {
         $jj = ($k - 1) - $j;
       $dir_path = ereg_replace("[^a-z0-9._]", "", str_replace(" ", "_", str_replace("%20", "_", strtolower($calculated_category_path[$ii][$jj]['text']))));
       $calculated_category_string .= $dir_path . '/';		
     }
   }
   return $calculated_category_string;
 }
// EOF Categories and Products Images Folder Tree

Part of this contribution

 

 

That worked perfectly. Like a charm.

If you have a moment can you tell me how or why it worked?

Did i I miss something?

Posted

The real question is why was that function missing in the first place?

:unsure:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...