Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

option_type_feature


Guest

Recommended Posts

I have installed the contrib 'option type feature' and now my products have textboxes where buyers can type options.

My problem is that unlike other product attributes where there is a title then a value ie

-colour:blue

 

the textbox entries just have the value but not the title.

 

This is a problem because the options are not always displayed in the order they were entered when viewed in the cart/invoice so it is not possible to deduce which value they have entered the option against.

 

Has it been installed wrong or have I set the product attributes incorrectly.

 

http://www.justrimless.com/catalog/product...products_id=168

 

If you want to see what I mean add some entries to the boxes then go to the cart, you will see that the titles like

a)Right SPH

does not carry accross.

 

Any help appreciated,

 

Rick

Link to comment
Share on other sites

Ok I had a problem with this as well, here is a post I made in the option type contribution support posting.

 

I figured it out, im gutted to say it was in the read me. so apologies to everyone having to read my posts. However I will spend the time enlightening you. The problem is, is that I had multiple TEXT fields defined in the table PRODUCT_OPTIONS_VALUES. (readme is explicit about only having one TEXT field)

 

What you need to do is go there via phpmyadmin and convert one of your existing text boxes to read as follows:

 

Edit | Delete | 0 | 1 | TEXT (0 for product_options_values_id is important)

 

You then need to go into your attributes for each product (bottom of page) and change the option value to TEXT where applicable.

 

I think this was everything that I done, it now works flawlessly.

 

You will also almost definately have a problem with your attributes jumbling up with each other when going through the checkout, I recently found the solution to this on these wonderful forums, however the link is on my works pc and I will have to post it tomorrow.

Link to comment
Share on other sites

I found the posting of the jumbling solution.

 

Original link to it is HERE

I would like to thank compugeek2003 for the solution, it has saved me no end. ;)

 

I did make alterations to the original posted code however as my shopping_cart.php had a slightly different original line to the "change this to this" posting (compare it with link provided).

 

File to edit is Catalog/Includes/Classes/shopping_cart.php. The line should be around line 56 if you have option type installed, I recommend searching for //attributes to get you to the right place.

 

change this

$attributes_query = tep_db_query("select products_options_id, products_options_value_id, products_options_value_text from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "'");

 

 

to this

$attributes_query = tep_db_query("select customers_basket_attributes_id, products_options_id, products_options_value_id, products_options_value_text from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "' order by customers_basket_attributes_id"); //ECS Edited - 04/25/2003

 

Please make sure your "change this" line is identical to mine if using the above code.

Edited by K3D
Link to comment
Share on other sites

Thanks for your help so far.

 

The jumbling is part of the problem but i also need the titles of the options

 

Because if somebody enters data into only 4 of the seven boxes I have, I dont know which one they added it to.

 

I have checked all of the merged files and they are OK so my guess is (since the titles are missing from the cart/invoice & picking slip) that there is a problem where the code writes the attributes title and data into the database.

Link to comment
Share on other sites

It is likely that you have assigned two or more TEXT value attributes when there should only be one.

 

be sure to check out the database table - product_options_values_id

 

make sure there is an entry as I have described above where you reference the TEXT as products_options_values_id = 0

 

otherwise if it is anything other that 0 you have to edit this section of catalog/includes/configure.php (bottom line of this chunk of code)

// CLR 020605 defines needed for Product Option Type feature.
define('PRODUCTS_OPTIONS_TYPE_SELECT', 0);
define('PRODUCTS_OPTIONS_TYPE_TEXT', 1);
define('PRODUCTS_OPTIONS_TYPE_RADIO', 2);
define('PRODUCTS_OPTIONS_TYPE_CHECKBOX', 3);
define('TEXT_PREFIX', 'txt_');
define('PRODUCTS_OPTIONS_VALUE_TEXT_ID', 0); //Must match id for user defined "TEXT" value in db table TABLE_PRODUCTS_OPTIONS_VALUES

 

note what I am saying is stated at the bottom part of this code.

Link to comment
Share on other sites

It is likely that you have assigned two or more TEXT value attributes when there should only be one.

 

be sure to check out the database table - product_options_values_id

 

make sure there is an entry as I have described above where you reference the TEXT as products_options_values_id = 0

 

otherwise if it is anything other that 0 you have to edit this section of catalog/includes/configure.php (bottom line of this chunk of code)

// CLR 020605 defines needed for Product Option Type feature.
define('PRODUCTS_OPTIONS_TYPE_SELECT', 0);
define('PRODUCTS_OPTIONS_TYPE_TEXT', 1);
define('PRODUCTS_OPTIONS_TYPE_RADIO', 2);
define('PRODUCTS_OPTIONS_TYPE_CHECKBOX', 3);
define('TEXT_PREFIX', 'txt_');
define('PRODUCTS_OPTIONS_VALUE_TEXT_ID', 0); //Must match id for user defined "TEXT" value in db table TABLE_PRODUCTS_OPTIONS_VALUES

 

note what I am saying is stated at the bottom part of this code.

 

I will try to have a look in the database, that is new to me. I have just installed phpmyadmin and need to configure it.

The code above is correct, I already checked that.

 

Thanks again.

Link to comment
Share on other sites

It is likely that you have assigned two or more TEXT value attributes when there should only be one.

 

With regard to this I have been looking in the product attributes part of the admin area and wondered...

 

Where I have these textbox attributes and in the 'option values' section should each option name have the option value of text?

Edited by Justrimless
Link to comment
Share on other sites

It is likely that you have assigned two or more TEXT value attributes when there should only be one.

 

be sure to check out the database table - product_options_values_id

 

make sure there is an entry as I have described above where you reference the TEXT as products_options_values_id = 0

 

otherwise if it is anything other that 0 you have to edit this section of catalog/includes/configure.php (bottom line of this chunk of code)

// CLR 020605 defines needed for Product Option Type feature.
define('PRODUCTS_OPTIONS_TYPE_SELECT', 0);
define('PRODUCTS_OPTIONS_TYPE_TEXT', 1);
define('PRODUCTS_OPTIONS_TYPE_RADIO', 2);
define('PRODUCTS_OPTIONS_TYPE_CHECKBOX', 3);
define('TEXT_PREFIX', 'txt_');
define('PRODUCTS_OPTIONS_VALUE_TEXT_ID', 0); //Must match id for user defined "TEXT" value in db table TABLE_PRODUCTS_OPTIONS_VALUES

 

note what I am saying is stated at the bottom part of this code.

Right, I have had a look in the database and there were several TEXT options none of which had a value of 0 so I have edited one to have a value of 0 and deleted all of the others.

It seems to have made no change.

 

I have found the following instruction on the readme and wondered if this needs looking into

 

'Some contributions require that the

products_options_values_to_products_options_id table list the

mapping of option types to option values.  If you use one of

these contributions, then you must add a new record to the

products_options_values_to_products_options

table whenever you setup a new text option. Currently there

is no admin tool for this step, so you must do it manually.

If necessary to do the above could somebody explain it a little more clearly.

Link to comment
Share on other sites

I have installed the contrib 'option type feature' and now my products have textboxes where buyers can type options.

My problem is that unlike other product attributes where there is a title then a value ie

-colour:blue

 

the textbox entries just have the value but not the title.

After advice in this thread I have been into the database and deleted any extra TEXT attributes, then reassigned TEXT attributes in the admin area where necessary and it works well.

However when i download with easypopulate, then re upload it goes t*ts up again.

Still now I can get it working the way I need with a bit of fidgeting.

 

Thanks to anyone who helped,

 

Rick

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