Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Option_Type_Feature_v1.6


JeffE

Recommended Posts

After carefully double-checking the README that came with the Option_Type_Feature (v1.6), no matter what I do the Option name isn't being displayed in the shopping cart, order confirmation, or confirmation email. After three days of troubleshooting, I am now asking anyone for help!

 

Here's where I am at:

 

The new Option name is "IMEI" and it is a text box for customers to enter a 15-digit number that needs to be passed along with the order. It appears fine on the catalog/product_info.php?products_id=28 page, but when the number is entered into the text field and the "Add to Cart" button is pressed to continue along to the catalog/shopping_cart.php, it does not appear in the Product(s) list. Instead, what I get on the catalog/shopping_cart.php page is a blank space where the text info for "IMEI" should be. In total, the customer chooses 3 options when purchasing a Nokia Wireless Unlock Code:

 

ie. the Product field displays:

 

Nokia Wireless Unlock Code

- <blank> ----> this is where the new IMEI text info should be!

- Model 3300 ----> this is a drop-down list option that works

- Network USA - T-Mobile, USA Inc ----> this is a drop-down list option that works

 

 

INSTALLATION CHECKLIST

 

STEP 1. Add new fields to db

 

I had to add the following fields to table products_options, either using an enclosed option_type_feature.sql or manually using the following definitions:

 

NAME: products_options_type

TYPE: int(5)

NULL: No

DEFAULT: 0

 

NAME: products_options_length

TYPE: smallint(2)

NULL: No

DEFAULT: 32

 

NAME: products_options_comment

TYPE: varchar(32)

NULL: Yes

DEFAULT: NULL

 

Add the following field to table customer_basket_attributes

 

NAME: products_options_value_text

TYPE: varchar(32)

NULL: Yes

DEFAULT: Null

 

************DONE - fields successfully added.

 

STEP 2. Install files containing the feature into your version of osCommerce

 

************DONE, all files were carefully merged (even though I started with a clean version) and

then uploaded to the server.

 

Then, I needed to apply CHANGES TO catalog/includes/configure.php, specifically:

 

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

 

************THIS WAS MERGED SUCCESSFULLY & UPLOADED

 

Then, I Checked if PRODUCTS_OPTIONS_VALUE_TEXT_ID matches id for user defined "TEXT" ...:

 

My Table products_options_values READ THE FOLLOWING:

 

products_options_values_id = 0

language_id = 1

products_options_values_name = TEXT

 

products_options_values_id = 0

language_id = 2

products_options_values_name = TEXT

 

products_options_values_id = 0

language_id = 3

products_options_values_name = TEXT

 

STEP 3. Set up your TEXT Option Value.

 

Instructions were: Add a new record to the table products_options_values. You can either use the enclosed insert_text_option_value.sql or you can manually update the table. (Note: The file will create three entries with products_options_values_id=0. One with language_id=1 (English), one with language_id=2 (German), and one with language_id=3 (Spanish). If you use other languages then you must create a new entry for each additional language.)

 

************DONE, Table products_options_values reads as above

 

4. HOW TO SETUP PRODUCTS TO USE DIFFERENT OPTION TYPES

4.1 How to Create a Text Option (or two or three...)

 

Instructions:

STEP 1. Use the admin tool to create a new Products Option. (In upper left table)

 

OPTION NAME: First Name <------ Note: I used "IMEI" instead of "First Name" ------>

 

Set the Option Type equal to 'Text'. This is done using the option type dropdown. (If you don't see an option type dropdown, then you likely didn't install the admin files that came with this feature.) The option type can also be updated manually in the table products_options.

 

***********DONE, this works fine.

 

OPTIONAL:

 

Also in table products_options set the products_options_length and/or products_options_comment. These values must be manually edited in the table.

 

I checked the table products_options, WHICH READS THE FOLLOWING:

 

products_options_id=9

language_id=1

products_options_name=IMEI

products_options_type=1 **

products_options_length=33

products_options_comment=NULL

 

**(NOTE: my other product options, Model & Network both=0, not sure if the new should read 1 or not)

 

************DONE

 

 

STEP 2. Use the admin tool to create a new Product Attribute.

 

Created:

PRODUCT NAME: Nokia

OPTION NAME: IMEI

OPTION VALUE: TEXT

VALUE PRICE: 0

PREFIX: +

 

**************DONE, and the new attribute joined the others in the list, properly

 

STEP 3. Update the Product Options to Product Options Values mapping.

 

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.

 

products_options_values_to_products_options_id=Let this autogenerate

products_opitons_id=Id from step 1

products_options_values_id=value of PRODUCTS_OPTIONS_VALUE_TEXT_ID (likely 0)

 

My Table products_options_values_to_products_options READS:

 

products_options_values_to_products_options_id=33

products_options_id=9

products_options_values_id=0

 

** I'm not sure if I've done something here or not ----- I am a first time user of PHPMyAdmin and this is the first time I've adjusted a MySQL database. I believe I've set it up properly, but obviously not ....

 

From the README FAQs, my problem is listed there, which reads:

 

Q. The Option name isn't being displayed in the shopping cart, order confirmation, or confirmation email?

 

A. This almost always indicates a problem with your data. Make sure that define('PRODUCTS_OPTIONS_VALUE_TEXT_ID', 0); is set correctly in your configure.php. [CHECKED THIS, IT IS OKAY] Also make sure that your product attribute is associated with the correct Option and Option Value. A common mistake is to associate a text Option with an Option Value other than TEXT.

 

Appears in "Product Attributes" (in admin) as:

Product Name: Nokia Unlock Code

Option Name: IMEI

Option Value: TEXT

Value Price: 0.0000

Prefix: +

 

HELP! Can anyone tell from the information I've provided above WHY the new text Option name "IMEI" and the string of numbers that are entered in the field by the user are NOT being displayed on the shopping cart or further pages as the order is confirmed?

 

Much Thanks!

 

Jeff

Link to comment
Share on other sites

Hi Jeff

 

I am in the same boat as you but mine doesn't work at all. This is what I get.

 

 

1054 - Unknown column 'popt.products_options_comment' in 'field list'

 

select distinct popt.products_options_id, popt.products_options_name, popt.products_options_type, popt.products_options_length, popt.products_options_comment from products_options popt, products_attributes patrib where patrib.products_id='49' and patrib.options_id = popt.products_options_id and popt.language_id = '1' order by popt.products_options_name

 

[TEP STOP]

 

 

I followed the instructions word for word and failed to get this option working.

 

for 2 weeks now I have been asking what is wrong and have posted 3 threads on this subject, for some reason nobody seems to want to answer me, either nobody has this option installed and running or it is a trade secret as to why it doesn't work

 

If you get an answer I would love to know what it is.

 

Cheers

 

Steve

Link to comment
Share on other sites

Ok I think I can see some problems here with my database.

 

you have

 

My Table products_options_values READ THE FOLLOWING:

 

products_options_values_id = 0

language_id = 1

products_options_values_name = TEXT

 

products_options_values_id = 0

language_id = 2

products_options_values_name = TEXT

 

products_options_values_id = 0

language_id = 3

products_options_values_name = TEXT

 

I have

 

products_option_values_id int(11) No 0

language_id int(11) No 0

products_options_values_name text No

products_option_type int(5) No 0

products_option_length smallint(2) No 32

products_options_comments varchar(32) Yes Null

 

when I ran that sql script that had 0, 1, Text etc in it I got duplicate values and nothing happened so how come you have it 3 times.

 

You have

 

products_options_id=9

language_id=1

products_options_name=IMEI

products_options_type=1 **

products_options_length=33

products_options_comment=NULL

 

I have

 

products_option_id int(11) No 0

language_id int(11) No 0

products_options_name varchar(32) No 1

products_option_type int(5) No 0

products_option_length smallint(2) No 32

products_options_comments varchar(32) Yes

 

you have

 

products_options_values_to_products_options_id=33

products_options_id=9

products_options_values_id=0

 

I have

 

products_options_values_to_products_options_id int(11) No auto_increment

products_options_id int(11) No 0

products_options_values_id int(11) No 0

 

so wy are your values so different to mine and why do I knot have as many entries as you?

Link to comment
Share on other sites

Hi Steve

 

I am a newbie when it comes to the databases so I'm afraid I can't help much ......... what I did was download phpmyadmin and used that to go through every table and make sure that the settings are what they are supposed to be according to the README that came with the download, and made a checklist as I went along to make sure I didn't miss anything.

 

I don't have php or the database local, so I need to upload my changes and then refresh my browser to see them take effect.

 

After a lot of dinking around, I managed to get the option working okay in the Admin section (ie. so I can add a TEXT field to a product), it properly displays the TEXT field under the product in the product_info page, and the field allows the user to enter text properly (you should be able to get that far). It's just not displaying properly on any further pages.

 

I think that if you use PhpMyAdmin you'll see that some of your tables are not set up according to the instructions.

 

I think one of two things are still wrong with mine:

 

1. My database settings are still not correct (the instructions are a little unclear), or

2. The option is no longer compatible with the newest version of OSCommerce.

 

I used WinMerge to compare the updated files to mine, and it appears as though the only differences were those specific to the update ----- the 'versions' appeared similar in every other respect, and WinMerge confirmed that they were identical after I applied the updates to my pages (I copy & pasted each difference rather than merge them to be sure they took effect).

 

I'm not sure what I can do to help you get a little further with it besides letting you know which tools I used. Like I said, I'm a newbie to PHP and databases --- luckily I'm a quick learner.

 

It works properly here:

http://www.OpenStoreSolutions.com/option_t...ontribution.php

 

So if I can figure out a solution from there, I will post it. I'm not sure whether they used the current or and older version of OSCommerce --- personally, I'd revert to an older version just to get the option working.

 

Just can't seem to find any help yet .... wish I could find the author, Chandra Roukema. I've emailed a couple of people, and I'm going to email [email protected] so see if anyone there can help.

 

I'll post whatever I find .......

 

Jeff

Link to comment
Share on other sites

Hi Jeff

 

Thanks for your support in my hours of need but I have fixed the problem.

 

I had written comments instead of comment in that database field.

 

It all works firn now and I get all the write info out the other end including the submitted text on all the emails it sends and order and invoices.

 

Cheers

 

Steve

Link to comment
Share on other sites

  • 5 months later...

I am curious if you ever figured out your problem, as I am having a similar problem. On my checkout confirmation page, all the information entered by the user in a text field is present. However, when I view the order via Admin, all the entries simply list the word TEXT. I too have verified that my database settings are correct and don't know where to go from here.

 

Thanks...

Link to comment
Share on other sites

  • 2 weeks later...
After carefully double-checking the README that came with the Option_Type_Feature (v1.6), no matter what I do the Option name isn't being displayed in the shopping cart, order confirmation, or confirmation email. After three days of troubleshooting, I am now asking anyone for help!

 

I have this exact same problem, The operations on the customers side is ok but all i get on the order invoice in my admin area is text and not what the customer typed in.

 

Any one found an answe to this problem yet, Would love to hear the solution.

 

thanx

Link to comment
Share on other sites

I have this exact same problem, The operations on the customers side is ok but all i get on the order invoice in my admin area is text and not what the customer typed in.

 

Any one found an answe to this problem yet, Would love to hear the solution.

 

In my case, it was the paypal shopping cart ipn contribution that was getting in the way. You may want to double check any additional contributions you've added, if any.

Link to comment
Share on other sites

  • 4 months later...

I have this contribution installed and it is working very well. FI am only having one problem that I can not seem to resolve.

 

I have added a price value to a text field for one of my attributes. The idea is that if someone adds any text to the field for this attribute then the value prie is added to the cost of the item. EX:

 

Coffee Mug plain = $5.00

----- add your name + $5.00

Total : $10.00

 

 

However the value price never gets added. I am sure this is a simple fix that I am just missing. I don't think this function is included in the original code.

 

If there is someone who has done this or knows how I would really appreciate hearing from you. I can even pay a little for the help.

 

Thx.!!

Link to comment
Share on other sites

I am not running the PayPal IPN in this particular instance .. just the default PayPal module that comes with v2.2

 

What did you have to do to fix it?  I'm having this same problem

Thanks

 

Can anyone tell me if the default installation of the Option Type Contibution does offer added value pricing for text fields ? Has anyone got this to work ? I would be interested to know.

Link to comment
Share on other sites

  • 3 weeks later...

New problem.....

 

I'm using the option type feature contribution with the Paypal IPN contribution. I've FINALLY gotten it to pass the entered text to the order in the administration control panel, but it's NOT passing the text to the email that is received. Any one have any ideas?

 

Here's a sample of what I'm talking about:

 

Date Ordered: Wednesday 20 October, 2004

 

Products

------------------------------------------------------

1 x I.D. Tags (MDID) = $8.00

Line 1 TEXT

Line 2 TEXT

Silencer Color Yellow

Type Military Set

Line 3 TEXT

Line 4 TEXT

Line 5 TEXT

------------------------------------------------------

Sub-Total: $8.00

Sales Tax: $0.70

Total: $8.70

 

 

 

 

Yet in the admin area, the information is there:

 

1 x I.D. Tags

- Type: Military Set

- Silencer Color: Yellow

- Line 2: testing line 2

- Line 1: testing line 1

- Line 5: testing line 5

- Line 4: testing line 4

- Line 3: testing line 3

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