Sale!
Product Input Fields for WooCommerce

Product Input Fields for WooCommerce

Product Input Fields for WooCommerce

Add custom frontend input fields to WooCommerce products.

Clear
SKU: N/A. Category: . Tags: , .

Description

Product Input Fields for WooCommerce plugin lets you add custom input fields to WooCommerce product’s frontend for customer to fill before adding product to cart.

Frontend Options

Product Input Fields for WooCommerce - Frontend Options

Position
Defines the fields position on frontend. If set to "Do not display", you can use [alg_display_product_input_fields] shortcode, or PHP alg_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
Position Priority
Use this to move the fields inside the "Position". Ignored if "Position" is set to "Do not display".
Default: 10
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">
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>
HTML to Add After Product Input Fields
This is added after the fields.
Default:

</table>
HTML to Add After Required Field Title
Defines how required fields are marked on frontend.
Default:

 <abbr class="required" title="required">*</abbr>
Add HTML Required Attribute
Adds HTML required attribute.
Default: yes
Item Name Order Table Format
Affects Checkout, Emails and Admin Orders View.
Default:

 | %title% %value%
Refill Fields with Previous Input
Default: yes

Emails Options

Product Input Fields for WooCommerce - Email Options

Attach Files to Admin's New Order Emails
Default: yes
Attach Files to Customer's Processing Order Emails
Default: yes

Total Number of Global (i.e. for All Products) Fields

Product Input Fields for WooCommerce - Global Fields - Total Number

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
Product Input Fields Number
After you save this number, new settings sections for each product input field will appear.
Default: 1

Global (i.e. for All Products) Field Options

Product Input Fields for WooCommerce - Global Field Options

Product Input Field X

Enable/Disable
Enables the field.
Default: no

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.
Default: Text
Is Required
Check if the field is required.
Default: no
Title
Field's title.
Default:

Input Field
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!

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
Value for OFF
Text to be shown if checkbox is not checked.
Default: No

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
Message on Wrong File Type
Message to be displayed if file type is wrong.
Default:

Wrong file type!
Max File Size
Set to zero to accept all files. In bytes.
Default: 0
Message on Max File Size Exceeded
Message to be displayed if file is too big.
Default:

File is too big!

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
Max Date
In days.
Default: 365
Add Year Selector
Default: no
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
First Week Day
Possible values: Sunday; Monday; Tuesday; Wednesday; Thursday; Friday; Saturday.
Default: Sunday

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
Interval
In minutes.
Default: 15

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

Product Input Fields for WooCommerce - Local 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']).

Reviews

There are no reviews yet.

Be the first to review “Product Input Fields for WooCommerce”

6 thoughts on "Product Input Fields for WooCommerce"

  1. WRF August 25, 2017 at 2:14 pm #

    We would like to translate our products with WPML and WooCommerce Multilingual. But the extra Product Input Fields are not displayed at the product pages of the other languages (or at translation management). What should we do?

    Reply

  2. Tobias Luger November 23, 2017 at 10:56 am #

    Hey,

    why do you not answere?
    The Upload Type have a BIG bug.

    No multiple file Upload inputs per product is working.

    Reply

  3. rebecca November 30, 2017 at 11:49 am #

    Hi,

    I have used the plugin to add 19 fields to a product. I then duplicated the product expecting to see the 19 input fields duplicated as well – this was not the case.

    I only want additional input fields on one category of product so I have not set the input fields for All Products.

    How do I duplicate the 19 input fields when I duplicate a product?

    Reply

    • rebecca November 30, 2017 at 12:26 pm #

      The issue is fixed by updating woocommerce to the latest version.

      Thanks

      Reply

  4. innonet December 14, 2017 at 8:18 pm #

    How do I disable sundays in the datepicker?

    Thanks.

    Reply

    • innonet December 14, 2017 at 10:41 pm #

      Fixed by changing alg-datepicker.js to:

      /**
      * alg-datepicker.
      *
      * @version 1.0.0
      * @since 1.0.0
      */
      function disableSUNDAYS(date) {
      var day = date.getDay();
      return [(day != 0), ”];
      }
      jQuery(document).ready(function() {
      jQuery(“input[display=’date’]”).each( function () {
      jQuery(this).datepicker({
      dateFormat : jQuery(this).attr(“dateformat”),
      minDate : jQuery(this).attr(“mindate”),
      maxDate : jQuery(this).attr(“maxdate”),
      firstDay : jQuery(this).attr(“firstday”),
      changeYear: jQuery(this).attr(“changeyear”),
      yearRange: jQuery(this).attr(“yearrange”),
      beforeShowDay: disableSUNDAYS
      });
      });
      });

      Reply

Leave a Reply

Changelog

= 1.1.1 - 30/10/2017 =
* Dev - WooCommerce v3.2 compatibility - Admin settings - select type options fixed.
* Dev - WooCommerce v3.0 compatibility - "woocommerce_add_order_item_meta hook uses out of date data structures and function is deprecated..." notice fixed.
* Fix - add_product_input_fields_to_order_item_meta() - Checking if product input fields values exist (fixes notice in log).
* Dev - Saving settings array as main class property.

= 1.1.0 - 15/06/2017 =
* Dev - WooCommerce 3.x.x compatibility - output_custom_input_fields_in_admin_order() - Using meta_exists() and get_meta() functions to access order items meta data.
* Dev - WooCommerce 3.x.x compatibility - alg_get_frontend_product_input_fields() - Product ID (using get_id() function instead of accessing id object property directly).
* Dev - Core - add_files_to_email_attachments() - Additional validation added.
* Tweak - Plugin link updated from https://coder.fm to https://wpcodefactory.com.

= 1.0.1 - 28/03/2017 =
* Dev - Language (POT) file added.
* Dev - readme.txt updated (screenshots added etc.).
* Tweak - http replaced with https in links to coder.fm.

= 1.0.0 - 28/03/2017 =
* Initial Release.

Installation

  • Buy the plugin 🙂
  • Download plugin's zip to your computer (you will receive an email with download link, or you can always download the plugin from your account).
  • Go to Admin Dashboard > Plugins > Add New > Upload Plugin and browse for downloaded zip file.
  • If plugin is successfully installed - you should see it added to the Plugins list.

Updates

To keep WPCodeFactory items up to date, please install WPCodeFactory Helper plugin and enter your site key.

Summary

Name: Product Input Fields for WooCommerce Pro
Version: 1.1.1
Last updated: 2 months ago
Requires WordPress version: 4.4
Tested up to WordPress version: 4.8
Author: Tom Anbinder

Free Version

Homepage https://wordpress.org/plugins/product-input-fields-for-woocommerce
Download https://downloads.wordpress.org/plugin/product-input-fields-for-woocommerce.zip
Support forum https://wordpress.org/support/plugin/product-input-fields-for-woocommerce