Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Product Attributes - Option Type Feature v1.3


Recommended Posts

I've had quite a few requests lately to update the option type feature to a recent snapshot, so here it is.


V1.3 upgrades the option type feature to the January 7th, 2003 snapshot of osCommerce. It also fixes a couple of bugs.


Summary of contribution: Provides text options for products.


Here is the description from the original contribution:


The purpose of this contribution is to allow the use of various option types

when setting up product attributes. With the current CVS version of

osCommerce, all options are displayed with select lists for user input. This

contribution specifically adds the ability to display options with text input

boxes. This allows a store owner to collect customization/personalization

information for a product from the end user. The contribution is written in

such a way that the addition of other option types such as Radio Buttons should be reasonably simple to add.


Here's a link to the contribution:






Link to comment
Share on other sites

  • 5 weeks later...
  • Replies 74
  • Created
  • Last Reply

Top Posters In This Topic

Hallo Chandra,

i have a big Problem with this Contrib.

Sorry my Englisch is very Bad.


My problem is not that the values read from the railways functions, but the free texts. And this Contrib is that which I for the moment at most needs, would be you very very gratefully if you that regard could!


If you should have time write me please thereby I you the entrance data give can. If you time do not have write me please also.


Big thx rigo


My Mail : bauerrigobert@web.de

Link to comment
Share on other sites

Excuse please Chandra, but my problem exists still.

It is definitely no error in the shoping_cart into that classes.

But I do not find the error.

Genuinly mad would be if you something time for me would have around this problem to repair!


Thank you to you already in advance!


mfg Rigo



Announce you to request if you time to have should I send you then the entrance data!

Link to comment
Share on other sites

  • 1 year later...



Great contribution and a big help. Just a couple of problems. Both the radio buttons and the select list work fine. The checkboxes don't. The problem is that firstly the product_info page only displays one of the options and secondly it doesn't show the option name. See:




There should be a name to that checkbox.


The shopping basket works fine, though. I reckon the problem is in this line:


echo '<tr><td class="main">' . $products_options_name['products_options_name'] . ': </td><td class="main">'. $products_options_name['products_options_values_name'] ;


- shouldn't there also be a name field other than $products_options_name which doesn't seem to return anything? Shouldn't the database query also include the table products_options_values which has the checkbox title in?


I've double checked that the page has been merged properly. I've attached the checkbox portion below just in case...



//CLR 030714 Add logic for checkboxes

$products_attribs_query = tep_db_query("select distinct patrib.options_values_id, patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");

$products_attribs_array = tep_db_fetch_array($products_attribs_query);



echo '<tr><td class="main">' . $products_options_name['products_options_name'] . ': </td><td class="main">'. $products_options_name['products_options_values_name'] ;



echo tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id']);

echo $products_options_name['products_options_comment'] ;

if ($products_attribs_array['options_values_price'] != '0') {

echo '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], $product_info_values['products_tax_class_id']) .') ';


echo '</td></tr>';




Many many thanks - it's a great mod which should have been implemented in the main system



Richard Pain

Link to comment
Share on other sites

  • 2 months later...

Anyone have any luck at all with multiple checkboxes?? Does this contribution not have that ability? By multiple, I don't mean separate checkboxes, I mean multiple checkbozes with the same name, so that the user can choose more than one.

Edited by blahblah
Link to comment
Share on other sites

  • 5 months later...

I installed Product Attributes - Option Type Feature on my site successfully.


But I find that if my text option message is around 100 words it does not wrap around in the checkout_confirmation.php display.


It does wrap around in the shopping cart display but throughs my tables out of alignment in the checkout_confirmation.php


Has anyone encountered this problem? Any ideas on how to fix it?





Link to comment
Share on other sites

  • 1 year later...

Hi everyone. I've successfully done quite a bit of modifying and such to OSC... but all of it has been through the individual files. I know NOTHING about myPHPadmin, except where it is in my control panel... and you have to use it, apparantly, to install this mod.


So basically... I'm wondering if anyone here can head me to a beginner's "How-To" for myPHPadmin... I've tried to read the documentation for it, but it's over my head... too many terms I don't know. I know I can do this, if I can just find a basic-enough introduction to myPHPadmin for me to learn how it works!


Can anyone point me in the right direction, please? I don't know where else to ask!

Link to comment
Share on other sites

  • 1 year later...



I am having major problems installing this!!


I have tried merging it with my files on my modified site, but i couldn’t get it to work, i have also tried to install it on a fresh install of OSC.


i can get the options to show in the admin section of "product attributes" but when i set it to one of the different options i.e.: check box or text area it still comes out in a dropdown box on the product info page.


Any suggestions to sort this would be much appreciated.





Link to comment
Share on other sites

  • 5 weeks later...

Did you check in the database whats stored for that product ? You can also debug the product_info.php page so see why you display the wrong display method. it works fine so you must have wrongly installed or you have a side effect due to another contribution.


We cannot do more..it's up to you to understand the php code. It's not so difficult.



Link to comment
Share on other sites

Hi, I've hit a problem with this. I've got everything installed.


In the products attributes screen in the admin panel, I can enter the field name, type and length OK and add that to the Product Options list OK; however how do I then assign this type of field to a particular product? If I go through the normal osC process for adding a field to a product, I have to select the product name I want to add it to in the Products Attributes area, then select an Option Name, all OK so far, but then I have to select an Option Value. Whether or not I choose something here, I end up with a combo box in my product listing even though I selected Text Box, which is exactly what I could achieve without this contribution. Am I missing something?


Of lesser importance, but annoying, is in the Product Options list, the option name field is missing. The header row has ID, Option Name, Option Type, Length etc, however the actual data in the table has the values for ID in the ID column, but then option type appears under the Option Name column, Length under the Option Values column and so on.


Can anyone point out firstly what I'm doing wrong about implementing this contribution (i.e. how I get the input text field into the product description), and secondly why the Option Name field isn't showing?



Link to comment
Share on other sites

Uh, the fix for the first problem was to upload ALL of the files in the contribution! B)


Still no luck on the second one though... the admin table doesn't line up properly... but at least the basic contribution works. Thoughts?

Link to comment
Share on other sites

  • 3 weeks later...

I am unable to add any options to my products, whether old products or new. All the options previously added are showing up fine, but when I go through admin and try to edit an existing product, it deletes all the options attached to that product, and new products cannot have options added either.


The ONLY thing different is that we recently upgraded php to 4.4.7


Can you guys help at all? This is costing me serious money, as I'm having a huge sale and my best-selling product suddenly has no options ... and requires a lot of them for a correct order!


Desperate here!



Link to comment
Share on other sites

Anybody here?


Need help with attribute bug pretty bad. My bestseller is now unpurchasable!


Help please.


php version should not make any difference. Do you errors in your application server (eg apache) for example ? Any change in the php settings : registers global, etc. ?

Link to comment
Share on other sites

Hello all,


I am hoping that someone can assist me with a small but very annoying problem. I have this contribution installed and everything works fine in Firefox, but I am getting a display problem of the text box in Internet Explorer. Instead of the text box expanding horizontally to the right, it expands vertically downward.


You can see what I mean here: http://www.smartersigns.net/jh/product_inf...;products_id=46


as well as the code in my product_info.php file relating to the text box:



           //CLR 030714 Add logic for text option
           $products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");
           $products_attribs_array = tep_db_fetch_array($products_attribs_query);
	$tmp_html = '<textarea onKeyDown="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" 
							   onKeyUp="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" 
							   onFocus="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" 
							   name="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" 
							   id="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" 
							   value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] . '"></textarea>
					<div id="progressbar' . $products_options_name['products_options_id'] . '" class="progress"></div>
					<script>textCounter(document.getElementById("id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"),"progressbar' . $products_options_name['products_options_id'] . '",' . $products_options_name['products_options_length'] . ')</script>';?>	<!-- DDB - 041031 - Form Field Progress Bar //-->


Any ideas, anyone?


Thanks in advance!


Link to comment
Share on other sites



I guess it has more to do with a wrong table, tr or td tag somewhere. As I added this piece of software to this contribution, I'm aware of a bug in Firefox where the box extends once you have reached the maximum string size.


But this is not your bug. Did you check with FF mod HTML Validator to check your html code ?

Link to comment
Share on other sites

Love the contribution. One problem I've pulled my hair out over. I can not get the attributes to list the attribute name on the outgoing email.

(see example below)


1 x B/W Corporate/Staff business card






6: Qty 1000



I actually have 6 attributes with 3 of them being phone numbers. The only attribute that shows a name is #6. #1 is David, #2 is a phone number etc... (but only 6: Qty is showing up).


I can see the attribute names while checking out but they do not come through on the email. (I hope this is makeing sense)


I have a strong feeling this is in the checkout_process.php file


any help is greatly appreciated.



Link to comment
Share on other sites

Going through the paces here before opening up this new Contrib on my store. I'm going to use it with Discount Coupons as a Gift Certificate module. Coupla small issues. 1: As mentioned, format breaks on checkout_confirmation as well as other areas like admin. 2: Order Editor cuts the string somewhere around 35 characters. 3: When ordering several items, the attributes are in reverse order for all but the last item.(not a big deal, but it makes an impression of an unprofessional site)

Link to comment
Share on other sites

Trying make this contribution work with QTPro. Can anyone help me?


I just need the text input field to allow personalization for my products (no need for ck boxes nor radio buttons). Already have QTPro installed.



I seccond that. I can not make the two play nicely together either. :rolleyes:

Link to comment
Share on other sites

  • 3 weeks later...

Anyone have problems integrating this mod with Paypal? I've installed it and added two custom text boxes on the product listing (I have a client selling t-shirts and wanted custom sayings) when I type a custom saying into the text box I can view it through all of the OSCommerce checkout pages perfectly, but once I get to Paypal to run payments, the custom text saying disappears and then it relays the info back to my OSCommerce without the custom saying, which my client will need to create the custom logo for the shirt. It's probably something I'm just missing through lack of sleep and delving through code, but I appreciate any help I can get!

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.

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