codyfresh Posted May 3, 2009 Posted May 3, 2009 IN the contribution: Option_type_feature_v2.0 I get the following error when I attempt to go to (products attributes) in admin screen. Parse error: syntax error, unexpected T_CASE in /home/content/c/o/d/codyfresh/html/catalog/admin/products_attributes.php on line 54 I searched it up and it was an error within the code I had to replace: Open catalog/admin/product_attributes.php ((the line of the code that is reading the error is in bold and underline so you maybe able to identify the problem better then I can because its now gettin frustrating to figure whats wrong with the code the instructions gave me. ---------------------- FIND: (around line 30) $option_name_array = $HTTP_POST_VARS['option_name']; for ($i=0, $n=sizeof($languages); $i<$n; $i ++) { $option_name = tep_db_prepare_input($option_name_array[$languages[$i]['id']]); tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS . " (products_options_id, products_options_name, language_id) values ('" . (int)$products_options_id . "', '" . tep_db_input($option_name) . "', '" . (int)$languages[$i]['id'] . "')"); REPLACE with // OTF contrib begins //$option_name_array = $HTTP_POST_VARS['option_name']; // //for ($i=0, $n=sizeof($languages); $i<$n; $i ++) { // $option_name = tep_db_prepare_input($option_name_array[$languages[$i]['id']]); // // tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS . " (products_options_id, products_options_name, language_id) values ('" . (int)$products_options_id . "', '" . tep_db_input($option_name) . "', '" . (int)$languages[$i]['id'] . "')"); $option_name_array = $HTTP_POST_VARS['option_name']; $option_type = $HTTP_POST_VARS['option_type']; //clr 030714 update to add option type to products_option $option_length = $HTTP_POST_VARS['option_length']; //clr 030714 update to add option length to products_option for ($i=0, $n=sizeof($languages); $i<$n; $i ++) { $option_name = tep_db_prepare_input($option_name_array[$languages[$i]['id']]); $option_comment = $HTTP_POST_VARS['option_comment']; //clr 030714 update to add option comment to products_option tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS . " (products_options_id, products_options_name, language_id, products_options_type, products_options_length, products_options_comment) values ('" . (int)$products_options_id . "', '" . tep_db_input($option_name) . "', '" . (int)$languages[$i]['id'] . "', '" . $option_type . "', '" . $option_length . "', '" . $option_comment[$languages[$i]['id']] . "')"); if($option_type != 0 && $option_type != 2){ tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " (products_options_id, products_options_values_id) values ('" . (int)$products_options_id . "', '0')"); } // OTF contrib ends Quote
Jonojamesmac Posted May 3, 2009 Posted May 3, 2009 can you see if the { on the bold line is closed anywhere? That or you could try adding an extra } above //OTF Contrib Ends Quote
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.