Guest Posted May 4, 2009 Posted May 4, 2009 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 Quote
germ Posted May 4, 2009 Posted May 4, 2009 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 Quote 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 >
Guest Posted May 5, 2009 Posted May 5, 2009 admin/includes/functions/general.phpadd 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? Quote
germ Posted May 5, 2009 Posted May 5, 2009 The real question is why was that function missing in the first place? :unsure: Quote 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 >
Recommended Posts
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.