New WooCommerce Extension - Custom Product Form Fields
I would love to see an Extension for WooCommerce to add "custom form fields" functionality to the products pages. In some cases extra information needs to be captured along with the product or service you are selling.
For example: I am selling services and I need to get a date, time, and driving directions from the purchaser.
Or I am selling a sign product and need to know a phone number, type (maybe a dropdown with options), and directions.
I can not find any cart solution (out of the box) that can do this. So a great addition to your WooCommerce could be "Product Forms Plugin" to allow users to create simple forms, then attach them to products to capture custom info. I would pay $$$ for this!!! Please consider developing this. I am sure many of us could use ad extension like this.
Often, I need to sell items where a user needs to specify some text. When purchasing such items, there should be a user input text field next to the quantity and price for personalized text to be entered. RegEx or other data limitations should be available.
The text field should also be editable from the shopping cart!
I wouldn't consider this completed with a 'hack' solution. I can't see adding code that would just be overwritten with the next upgrade/ update of my theme, woocommerce, or wordpress. Seems like this is a basic need for most stores. I have a store i'm working on now that needs customer input and ideally i'd like to put it on a product detail page (not during checkout) since it pertains to the actual product they are on.
Is there no 'select date' function with that add-on?
Ed Wait commented
Based on Ahmed Shaker's comment from May 29, re using Gravity Forms.
I'm looking to add a form to the product page that will let people pick a color and add a few lines of text, etc.
Often people order more than one product and there is a separate form for each product.
Once they complete the fields, will that information be saved to the either the checkout page or cart page or both? And, will they be able to edit it at checkout ??
Ahmed Shaker commented
and how do we make the product custom text NOT show up as a slug? someone else had this problem too. Thank you.
what about just if then statements? could you do something simple like that even?
does Filtah's method work with the new 2.0 woocommerce? thanks.
Is there a possibility to add an extra price field? In Europe one would hve to add a 100g price or price per kilo for food products... how can i handle this issue?
Thanks for the code this works great. Only problem is it shows the text input as the slug on the cart page. E.g Happy Birthday Joe in the text input becomes happy-birthday-joe
@Filtah and @aschroder - thank you!!
I agree the "CUSTOM_TEXT" in the Additional Info doesn't look good, but I think that the whole area looks clunky, so I'm just going to remove it.
This hack has really got me out of a massive hole, I hope that WooCommerce will integrate this feature soon.
@filtah, @Tim Read - all is ok but like Tim my button "add to cart" is hidden...some1 can send any solution or something
Najeeb Ahmad commented
you can add extra fields and even file upload on product page by N-Media plugin:
It has also personalized/customized checkout option manager plugin:
I hope it will help
Got the custom field to work, however is there anyway to get rid of the "CUSTOM_TEXT" in the additional information tab?
Steve Tsonev commented
If it says completed what does that mean? and why would I still have to change the code in the variable.php in order to get custom product form fields? Wrodpress and woocommerce are so progressive in what they have to offer I am surprised they are missing such a basic feature. I mean by not including it they are excluded a large number of businesses that require custom fields, like bakeries(cakes), flowers (delivery), pizza (delivery), print (text, like a customer printed shirt to whatever)
By if this was implemented in why are people still unable to find it?
Tim Read commented
Thanks Konrad, finally got round to your fix. Good stuff
Konrad K. commented
It's because add-to-cart-variation.min.js doesn't see any option select so it makes add to cart button hidden. Simply woocommerce thinks that no option is selected.
Really ugly messy but working fix i've pasted here.
Hope it helps until someone takes more time to refine .js
Tim Read commented
Big props to @filtah for trying to sort this. I've got as far as seeing the free text box on my screen but my Add to basket button is missing. I have set a price for the variation. Any ideas?
One more thing, as mentioned before, to be able to use this fix you need to create a variable product. Add a custom product attribute with any name but with the value 'CUSTOM_TEXT' (without quotes..)
Save the page.
Now add a variation, give it a price, and save again.
You should see your custom text box now on the product page.
Right, I finally figured this out. The code posted earlier from github is correct, however the file and location of where to post it has completely changed!!!!
I figured it out by painstakingly searching all the source files text contents for similar code!!!!
I'm not php guru and there's a lot of code here. anyway, I figured it out and i'm posting as others may find this useful.
the file you are looking for is buried here:
You need to add only a few lines of code.
The code form github should be able to guide you but for gods sake, dont just copy-paste the whole thing!
I am using WooCommerce 1.6.6
It's too diffucult to explain how to edit the code, so heres a link to the patched version, so you can just replace your existing file without any need for coding:
Please note - if you update WooComerce it will overwrite and break this fix.
Please do yourself a favour and also have a look at the code so you can see the simple changes I've made - you will need to manually re-apply them for a version update as the code will probably be a bit different.