Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How do I add an input text box to a product?


gregp

Recommended Posts

Hi guys,

 

Does anyone know how to add a input text field to a product and have those values sent through to checkout and email notification etc? I'm sure it's not rocket science but I'm no SQL / PHP expert! There's an announcement on the OSC home page about product variants, and the second picture as shown below is exactly what I mean - front text and back text. How is this done?

 

osc30a5productinfo.jpg

 

Thanks in anticipation!

Greg

Link to comment
Share on other sites

Before you considered adding those text boxes into the product description page it's self - what made you not want to use the text input box that OSC provides during the checkout process? I can guess one possible reason is just to avoid confusion as it does make sense as the picture above presents it anda text box later on in the checkout process does'nt ask specifically for those fields..........

 

It's late at night for me so I'll come back here tomorrow and address the question it's self as well as I can. As it stands I dont know the answer off the top of my head. But if it's on the OSC homepage....(where is that exactly on the web - I'd like to see if myself in a browser if I can) then it has to be a contribution of some sort I'd gather. You know anything about contributions?

 

Anyway - I'll look at this more tomorrow.

Link to comment
Share on other sites

Thanks mate for the reply. Yeah basically what you said; the textbox in checkout is a general 'notes' field, and while I can use this (in fact that's what I'm presently doing) I'd much prefer to provide a dedicated box attached to the product itself. If, for example, someone was to order five T-shirts, the Notes field would get messy and confusing with all the printing information for all the shirts, as well as general order-related notes and whatever else you decide to use it for.

 

I did a contributions search to no avail, and the forums search simply revealed a couple of other similar questions which were unanswered.

 

Cheers!

Link to comment
Share on other sites

Did you have a chance to look at this contribution? Seems like it might be the ticket :) I have to say too, I LOVE the contribution coders that OSC has behind it. It makes this system really superb overall inho.

Link to comment
Share on other sites

Yeah I'd spotted that one before. I've been able to add combo box fields by using Product Attributes thus far, but I was put off this contribution by the comment on July 9 "Wanted: the ability to add a TEXT AREA is this possible?". Since this is almost exactly what I wanted to do, a text field rather than a text area, I figured this contribution wasn't able to do it. Am I wrong? I was also looking for a solution, ideally, that didn't give you 11 pages of code changes to implement! :rolleyes:

 

You could say 'just try it' and I probably will, but I've tried a number of different contributions to achieve certain outcomes, some of which have only partially worked, and I don't really want a dog's breakfast cart littered with a whole lot of half working contributions.

 

Thoughts? Particularly interested to hear from anyone who's used this contribution and knows what it can and can't do.

Link to comment
Share on other sites

OK I bit the bullet and installed this, fortunately the 11 pages of mods were only if you had problems. Which I have.

 

Firstly it appears from the admin section that this contribution only allows you to add pre-populated fields rather than those accepting input text. But I haven't actually seen the finished product in action, as when I load the product_info.php page I get:

 

 

Warning: split(): Invalid preceding regular expression in /var/www/html/catalog/product_info.php on line 103

1064 - You have an error in your SQL syntax near 'and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languag' at line 6

 

SELECT pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value ,pef.products_extra_fields_status as status FROM TABLE_PRODUCTS_EXTRA_FIELDS pef LEFT JOIN TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ptf ON ptf.products_extra_fields_id=pef.products_extra_fields_id WHERE ptf.products_id= and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='1') ORDER BY products_extra_fields_order

 

[TEP STOP]

 

The preceding expression is as follows:

 

// START: Extra Fields Contribution v2.0i with fix

list($products_id_clean) = split('{', $product_info['products_id']);

$extra_fields_query = tep_db_query("

 

Does that mean anything to anyone? I don't know enough about SQL commands to know if there's a code error. I just uploaded the new product_info.php file along with everything else with no modifications.

 

It would be nice to get this working and see how the extra fields are actually rendered, so I can say for certain whether or not this contribution does what has been suggested.

 

And BTW I agree that the open source nature of OSC and the contributions are great! Saves so much time on trying to hack something ugly out on your own! :)

 

Thanks in anticipation.

Greg

Link to comment
Share on other sites

Presuming the above is correct, i.e. that the Product Extra Fields contribution does NOT allow the creation of input text fields, are there any other suggestions on how I might achieve this in line with the opening post?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...