Text field – Wc Fields Factory

Product Field

Insert a text field (input[type=text]) on the product page.

Option Description
Placeholder Placeholder attribute’s value for this text field.
Default Value Default value for this text box – (This value will be used in-case If user hadn’t given any).
Maximum Characters Maximum number of characters that user can input on this field.
Required Make this text field mandatory – user cannot perform Add To Cart operation without filling this text box.
Message Message that has to be displayed when validation failed for this text field (When the Required Option is Set).
Visibility Whether this text field’s value (Given by the user) has to be displayed on the Cart & Check Page.
Note: Regardless of this option this fields value will be added as Order Meta (Unless you configured not so).
Order Item Meta Whether to add this field’s value (Given by the user) as Order Item Meta.
Logged in Users Only Make this field available only for the Registered Users only (They must have to be logged in).
Target Roles Make this field available only for the users that have the selected roles. Available to all, if you haven’t selected any
Editable Make this field’s value editable on Cart Page – (In case If user has gave a wrong value, he can correct it on the cart page itself, no need to go back to product page).
Note: this is only for the Cart page not for the Checkout Page.
Cloneable Exclude this field from cloning (Works only if Cloning option is enabled from the Settings Page).
Field Class Use this option to add a custom css class to this field for your own styling purpose.
Product Field Raw Output
<table class="wccpf_fields_table">
	<tbody>
		<tr>
			<!-- Label section starts here -->
			<td class="wccpf_label">
				<label for="test_product_text">Test Number Field</label>
			</td>
			<!-- Label section ends here -->
			
			<!-- Field section starts here -->
			<td class="wccpf_value">
				<!-- Actual field -->
				<input type="text" class="wccpf-field" name="test_product_text" value="" maxlength="" placeholder="" wccpf-type="text" wccpf-pattern="mandatory" wccpf-mandatory="yes" data-cloneable="yes" />
				<!-- Validation message -->
				<span class="wccpf-validation-message">Test text validation error message</span>
			</td>
			<!-- Field section ends here -->
		</tr>
	</tbody>
</table>

Admin Field

All the above options available for the Admin Field as well, along with those there are some specific options related to only Admin Fields.

Option Description
Show on Product Page Show this field on Front end Product page as well.
Read Only Whether to show this field as Read Only Field (applicable only on Front End Product Page).
Value or Field Show the value that is entered on this Admin Field instead as the Field itself. Whatever the value, Store Admin set for this field on the back end will be displayed on the Front end Product Page.
Format Format of the value – Text (default option), Price, Decimal, Stock or URL.
Tips Whether to show the tip icon in the back end.
Description Tool-tip message, when admin user click on the Tips Icon.
Admin Field Raw Output (on Product Page)
<p class="form-field test_admin_text_field">
	<!-- Admin field Label -->
	<label for="test_admin_text">Test Admin Text</label>
	<!-- Actual admin field -->
	<input type="text" class="wccaf-field" name="test_admin_text" value="" placeholder="" maxlength="" wccaf-type="text" wccaf-pattern="mandatory" wccaf-mandatory="no">
	<!-- Validation message -->
	<span class="wccaf-validation-message">Test admin text vallidation error message</span>
</p>
Admin Field Raw Output (on Product Category Create Page)
<div class="form-field">
	<!-- Admin field Label -->
	<label for="test_admin_text">Test Admin Text</label>
	<!-- Actual admin field -->
	<input type="text" class="wccaf-field" name="test_admin_text" value="" placeholder="" maxlength="" wccaf-type="text" wccaf-pattern="mandatory" wccaf-mandatory="no">
	<!-- Validation message -->
	<span class="wccaf-validation-message">Test admin text vallidation error message</span>
</div>
Admin Field Raw Output (on Product Category Edit Page)
<tr class="form-field">
	<!-- Admin Edit Category field's label starts here -->
	<th scope="row" valign="top">
		<label for="test_admin_text">Test Admin Text</label>
	</th>
	<!-- Admin Edit Category field's label ends here -->
	
	<!-- Admin Edit Category actual field starts here -->
	<td>
		<input type="text" class="wccaf-field" name="test_admin_text" value="" placeholder="" maxlength="" wccaf-type="text" wccaf-pattern="mandatory" wccaf-mandatory="no">
		<span class="wccaf-validation-message"></span>
	</td>
	<!-- Admin Edit Category actual field ends here -->
</tr>

Leave a Reply

Your email address will not be published. Required fields are marked *

 

6 Comment(s)

  1. prem January 27, 2018

    hi… this is very good plugin…. thanks for this….how i can change the price of the products when user select the one custom option of radio button… please help me

  2. Jon January 20, 2018

    The ADD pricing rule adds the extra amount twice and nothing I seem to do can alter this.
    I have a product at £90
    Using a select field and pricing rules for an optional donation of £10 on top adds this twice so the basket is £110 rather than £90 + £10 = £100?
    The select fields meta is 10.00|£10
    The pricing rule is If user chosen option => is equal to > £10 (selected on drop down)
    Then change the price to => Pricing title (Donation used here) Amount 10.00 and ADD as the type.

    Can anyone help?

  3. Sam December 25, 2017

    Hi, I like your plugin. I’m going to use it in product table, what is the code that I need to use to insert a field in product table?

    1. Saravana Kumar K December 28, 2017

      Hi, I am not sure about your requirement (Product Table.?), Using this plugin you can add custom fields to single product page, those fields are used to get additional information regarding the order. those fields value will be stored in the cart object only. So you cannot add any extra fields on Product Table (I guess you referring to DB table).

  4. Arvin Choi December 3, 2017

    Hey there, I downloaded your WP Fields factory plugin and I’m trying to implement it onto a wholesales order form so that it’ll show up on every item listed in a data table format. How will I be able to include this into something like this? Is there a shortcode or PHP code where I can input the field I created with your plugin?
    Thanks!

    1. Saravana Kumar K December 6, 2017

      Hi, shortcode will be available with my next release along with some other upgrades, but it would take some time (month at least).