Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

option_type contribution attribute error


Recommended Posts

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...