Product Input Fields for WooCommerce Pro plugin lets you add custom input fields to WooCommerce product’s frontend for customer to fill before adding product to cart.
Frontend Options
Plugin settings are located in “WooCommerce > Settings > Product Input Fields”.
- Position
- Defines the fields position on frontend. If set to “Do not display”, you can use
[alg_display_product_input_fields]
shortcode, or PHPalg_display_product_input_fields()
function. Possible values: Before add to cart button; After add to cart button; Do not display.- Default:
Before add to cart button
- Default:
- Position Priority
- Use this to move the fields inside the “Position”. Ignored if “Position” is set to “Do not display”.
- Default:
10
- Default:
- HTML to Add Before Product Input Fields
- This is added before the fields.
- Default:
<table id="alg-product-input-fields-table" class="alg-product-input-fields-table">
- Default:
- Product Input Field Template
- Used to display each field. Replaced values:
%field_id%
,%title%
,%field%
. Alternatively try e.g.:<p><label for="%field_id%">%title%</label>%field%</p>
- Default:
<tr><td><label for="%field_id%">%title%</label></td><td>%field%</td></tr>
- Default:
- HTML to Add After Product Input Fields
- This is added after the fields.
- Default:
</table>
- Default:
- HTML to Add After Required Field Title
- Defines how required fields are marked on frontend.
- Default:
<abbr class="required" title="required">*</abbr>
- Default:
- Add HTML Required Attribute
- Adds HTML
required
attribute.- Default:
yes
- Default:
- Item Name Order Table Format
- Affects Thank You page, Emails etc.
- Default:
| %title% %value%
- Default:
- Refill Fields with Previous Input
- Refills fields with previous input values.
- Default:
yes
- Default:
Emails Options
- Attach Files to Admin's New Order Emails
- Default:
yes
- Default:
- Attach Files to Customer's Processing Order Emails
- Default:
yes
- Default:
All Products Options
Total number of global (i.e. for all products) fields. When enabled this section will add new settings section for each product input field.
- Enable section
- Add custom input fields to all products.
- Default:
yes
- Default:
- Product Input Fields Number
- After you save this number, new settings sections for each product input field will appear.
- Default:
1
- Default:
All Products: Field X Options
Global (i.e. for all products) field options.
Product Input Field X
- Enable/Disable
- Enables the field.
- Default:
no
- Default:
General Options
- Type
- Field’s type. Possible values: Text; Textarea; Number; Checkbox; Color; File; Datepicker; Weekpicker; Timepicker; Select; Radio; Password; Country; Email; Phone; Search; URL; Range; Multi Checkbox.
- Default:
Text
- Default:
- Is Required
- Check if the field is required.
- Default:
no
- Default:
- Title
- Field’s title.
- Default:
Input Field
- Default:
- Placeholder
- Field’s placeholder.
- Default: None
- Default Value
- Default value. E.g. for Color type enter color code; for Checkbox type enter yes or no. Leave blank to disable.
- Default: None
- Class
- Field’s CSS class.
- Default: None
- Style
- Fields’s CSS style.
- Default: None
- Message on Required
- Used if “Add HTML Required Attribute” option in plugin’s “General > Frontend Options” settings is disabled, or product input fields are displayed outside the add to cart button form.
- Default:
Field '%title%' is required!
- Default:
- Uppercase
- Converts characters to uppercase version, when possible.
- Default:
no
- Default:
Input Restrictions
- Min
- Minimum value for an input field. E.g. for Number/Range type. Leave blank to disable.
- Default: None
- Max
- Maximum value for an input field. E.g. for Number/Range type. Leave blank to disable.
- Default: None
- Step
- Legal number intervals for an input field. E.g. for Number/Range type. Leave blank to disable.
- Default: None
- Max Length
- Maximum number of character for an input field. E.g. for Text type. Leave blank to disable.
- Default: None
- Pattern
- Regular expression to check the input value against. E.g. for Text type. Leave blank to disable. Visit documentation on regular expressions for valid option formats.
- Default: None
Checkbox Type Options
Fill this section only if Checkbox type is selected.
- Value for ON
- Text to be shown if checkbox is checked.
- Default:
Yes
- Default:
- Value for OFF
- Text to be shown if checkbox is not checked.
- Default:
No
- Default:
File Type Options
Fill this section only if File type is selected.
- Accepted File Types
- E.g.: “.jpg,.jpeg,.png”. Leave blank to accept all files. Visit documentation on input accept attribute for valid option formats.
- Default:
.jpg,.jpeg,.png
- Default:
- Message on Wrong File Type
- Message to be displayed if file type is wrong.
- Default:
Wrong file type!
- Default:
- Max File Size
- Set to zero to accept all files. In bytes.
- Default:
0
- Default:
- Message on Max File Size Exceeded
- Message to be displayed if file is too big.
- Default:
File is too big!
- Default:
Datepicker/Weekpicker Type Options
Fill this section only if Datepicker/Weekpicker type is selected.
- Date Format
- Leave blank to use your current WordPress format. Visit documentation on date and time formatting for valid date formats.
- Default: None
- Min Date
- In days.
- Default:
-365
- Default:
- Max Date
- In days.
- Default:
365
- Default:
- Add Year Selector
- Default:
no
- Default:
- Year Selector - Year Range
- Remember to set “Min Date” and “Max Date” options accordingly. Visit Datepicker > yearRange documentation for valid year range formats.
- Default:
c-10:c+10
- Default:
- First Week Day
- Possible values: Sunday; Monday; Tuesday; Wednesday; Thursday; Friday; Saturday.
- Default:
Sunday
- Default:
Timepicker Type Options
Fill this section only if Timepicker type is selected.
- Time Format
- Visit timepicker options page for valid time formats.
- Default:
hh:mm p
- Default:
- Interval
- In minutes.
- Default:
15
- Default:
Select/Radio Type Options
Fill this section only if Select/Radio type is selected.
- Options
- One option per line.
- Default: None
Per Product Field Options
Developers
Product input fields data is saved as order meta. Here is a snippet which demonstrates how to get entered values with PHP:
$order = wc_get_order( $order_id ); foreach ( $order->get_items() as $item_key => $item ) { foreach ( wc_get_order_item_meta( $item_key, '_alg_wc_pif_local' ) as $values ) { echo $values['_value']; } }
This example is for “local input fields” (i.e. per product); for “global input fields” (i.e. all products) use _alg_wc_pif_global
instead of _alg_wc_pif_local
. If the type of the field is “file”, then it’s saved as an array, so, for example, to get the name of the file, you need to use $values['_value']['name']
(instead of $values['_value']
).
Export
If you need to export the product input fields from orders to CSV or XML, we suggest using free Export WooCommerce plugin.
skragglies (verified owner) –
I’d like to clarify my review, since I can’t edit it I’ll add an additional review.
This plugin formats everything in tables. This doesn’t work for responsive designs. It takes a lot of css to get it to be mobile friendly. The options for dates and times are extremely limited. If you want to have time options from noon to five, for example, you have to find the timepicker javascript file, read jQuery documentation on it, then add in the minTime and maxTime variables.
That’s a lot of work to get a $60 plugin to work. Frankly, you are better off learning javascript and creating some custom code for your project.
skragglies (verified owner) –
This plugin is great if you can completely rewrite all of the jQuery strings that make it run. Otherwise it’s pretty much useless. Great idea, but abhorrent execution.
Ed –
Great plugin and customer support. Go for the pro version you won’t be disappointed.
Pablo Pacheco –
Thanks!
Jess –
Great plugin. Does everything I need it to. Support is fantastic
Pablo Pacheco –
Thanks!
Jeremy –
Great plugin – works really well and support is top notch.
Pablo Pacheco –
Thanks!
Dwayne (verified owner) –
Great plugin and fantastic customer support.
Pablo Pacheco –
Thanks!
Max –
Great plugin, lots of options…