Add Custom Fields to Woocommerce Admin products, Admin Product Category and Admin Product Tabs using WC Fields Factory

Introduction

Using WC Fields Factory now you have the ability to add custom fields to product’s admin, product admin category and product tabs. Using WC Fields Factory’s Admin Fields option you can add Text Box, Text Area, Number, Email, Select, Check Box, Radio Button, Date Picker and Color Picker.

How it works

In your wp-admin go to Fields Factory -> Add Admin Field, 90 percent of the work flow is same with Product Fields creation.

Step 1
Give a title to your Admin Fields Group.

Step 2
Use Fields Factory section to add custom fields. you can add as much as fields you want. You can also rearrange the order of fields by drag and drop.

Step 3
Use Condition section to add rules for this admin fields group, like you can assign this fields group to a particular product, category, tags, and product types. You can add as much as rules you want, and more than one rules can be combined with AND (or) OR logic.

Step 4
Use Location section to place your admin fields group where it has to be inserted. you can place this Admin Fields to product section or to any product tabs section. like you can place these fields under General product tabs or Inventory, Attributes, Variables etc.

Step 5
Click “Publish” button, that’s it, your fields group will be added to all Woocommerce product’s admin screen ( of course whichever meets those rules you have added ).

Here is the output
WCCAF Fields

How to access

Admin Product fields are stores as post meta ( here it’s product meta ), you can access any admin fields just like accessing any WordPress post meta. using get_post_meta() function.

/* Post Id or Product Id will do */
$my_admin_field_val = get_post_meta( $post->ID, "wccaf_your_admin_field_name", true );

Accessing admin fields value which assigned for Variable tab section, you should be giving $variable_id instead of $post->ID or $product->id

/* Variable id */
$my_admin_field_val = get_post_meta( $variable_id, "wccaf_your_admin_field_name", true );

*The key for the custom post meta always prefixed with wccaf_

Product category custom fields will be stored as options. you can access those values like

$my_admin_product_cat_val = get_option( "taxonomy_product_cat_". $your_term_id ."_wccaf_". $your_field_name " );

How to render admin fields on front end product page

This feature is supported from V1.3.1, but you will have to enable it for each fields. by default all admin fields will not be displayed in front end product page ( as the intention for this Admin Field is to add custom fields for Back End Admin screen )

Show on Product Page
This option has to be enabled in order to show the field on front end.

Show on Cart & Checkout
This option has to be enabled in order to show this custom meta on cart & checkout page

Order Item Meta
This option has to be enabled in order to add this custom meta as order item meta ( which will be added in order email as well )

WCCAF options

Leave a Reply to james Cancel reply

Your email address will not be published.

 

96 Comment(s)

  1. Prashant dhabushe March 21, 2018

    Great plugins thanks

  2. Kiran December 25, 2017

    Hello,

    I want to include a file upload field in my products list. Is it possible?

    1. Saravana Kumar K December 28, 2017

      Not possible now, that is something I am working on. will be available soon (might take a month or two).

  3. quantumtrax December 17, 2017

    Hello i want to reach and show value of a field on any page. how can i do that?

    1. Saravana Kumar K December 21, 2017

      I am working on shortcode feature, which should solve that, hopefully in my next release.

  4. Vincent December 11, 2017

    Hi, this is a great plug-in. I have 2 questions. I use it to collect attendees info, clone form for any additional quantity
    1) is there any way to report on a list of the orders along with the custom fields ( attendee info)
    2) instead of asking the customer to fill out the customer fields in the product page, is that possible to fill them out in the cart or check-page page?

    1. Saravana Kumar K December 12, 2017

      Hi, now its not possible, but those features are in our road map, we try to include it on our upcoming releases.

  5. Pingback: WC Fields Factory — 自定义 WooCommerce 商品或商品分类字段 _WordPress 智库

  6. Toni November 23, 2017

    Hi Saravana,
    Fantastic plugin, congratulations! just what I needed! 🙂
    But I have a problem, when I want to add a date picker to a product variation, the date selector does not work… Is it a bug?
    I am looking forward to your response,
    Thank you.

    1. Saravana Kumar K November 23, 2017

      Yes the issue is there, will be fixed with the upcoming release (hopefully in a couple of days).

  7. Alban November 21, 2017

    Hi Saravana,
    i add a custom tab on my product admin, and i want to place some fields created with your plugin in this custom tab.
    Unfortunately this custom tab isn’t shown in the select box of your location section.
    How can i had it to the list ?

    1. Saravana Kumar K November 21, 2017

      Hi you can use ” filter

      function wcpb_add_custom_product_tab($_tabs) {
      	$_tabs["Your Custom Tab"] = "woocommerce_product_your_custom_tab_slug";
      	return $_tabs;
      }
      add_filter('wcff/product/tabs', 'wcpb_add_custom_product_tab');
      
      1. Alban November 23, 2017

        Thanks for this first advise, it work : i can see my tab in the select box of the location section.
        Unfortunately i can’t see my field in the tab on the product’s admin panel.
        I declare my tab like this (and i see it, no problem) :

        $tabs[‘translate’] = array(
        ‘label’ => ‘Traduction’,

        What did you mean by slug for my tab, is it the label ?

        After create my tab, i put a div in it :

        1. Saravana Kumar K November 24, 2017

          Hi, in that tab content create callback (where you are putting DIV tag), place the following snippet.

          function inject_admin_fields_on_custom_tab() {
          	global $post;
          	$is_colorpicker_there = false;
          	$is_image_field_there = false;
          	$all_fields = apply_filters( 'wcff/load/all_fields', $post->ID, 'wccaf', "your_tab_slug" );
          		
          	foreach ( $all_fields as $title => $fields ) {
          		if( is_array($fields) &&  count( $fields ) > 0 ) {
          			foreach ( $fields as $key => $field ) {
          		
          				$mval = "";
                   			$mval = get_post_meta( $post->ID, "wccaf_".$field["name"], true );
          					
          				if( !$mval ) {
          					if( isset( $field["default_value"] ) && $field["type"] != "radio" && $field["type"] != "select" ) {
          						$mval = $field["default_value"];
          					} else {
          						$mval = "";
          					}
          				}
          					
          				$field["value"] = $mval;
          				$field["location"] = "your_tab_slug";					
          					
          				do_action( 'wccaf/before/field/start', $field );
          					
          				/* generate html for wccaf fields */
          				echo apply_filters( 'wcff/render/admin/field/type='.$field["type"], $field );
          					
           				do_action( 'wccaf/after/field/end', $field );				
          					
          			}
          		}
          	}	
          		
          	wccaf_fields_validation_for_custom_tab();
          		
          }
          

          Note: “your_tab_slug” means when your register your tab, you would have given the following details. Label, Target and Class. target is your tabs content slug.
          and this (for validation)

          function wccaf_fields_validation_for_custom_tab() { ?>
          	<script type="text/javascript">
          		var wccaf_is_valid = true;
          		(function($) {
          			$(document).ready(function(){
          				$( document ).on( "blur", ".wccaf-field", function(e) {										
          					doValidate( $(this) );
          					$("input[name=save]").removeClass("disabled");
          					$("input[name=save]").parent().find(".spinner").hide();
          				});	
          				$(document).on("submit", "#post", function(){			 
          					wccaf_is_valid = true;
          					$( ".wccaf-field" ).each(function(){
          						doValidate( $(this) );
          					});
          					setTimeout(function(){
          						$("input[name=save]").removeClass("disabled");
          						$("input[name=save]").parent().find(".spinner").hide();
          					}, 1000)				
          					return wccaf_is_valid;				
          				});
          				function doValidate( field ) {
          					if( field.attr("wccaf-type") != "radio" && field.attr("wccaf-type") != "checkbox" ) {					
          						if( field.attr("wccaf-mandatory") == "yes" ) {						
          							if( doPatterns( field.attr("wccaf-pattern"), field.val() ) ) {
          								field.parent().find("span.wccaf-validation-message").hide();
          							} else {		
          								wccaf_is_valid = false;
          								field.parent().find("span.wccaf-validation-message").css("display", "block");
          							}
          						}
          					} else {
          						if( field.attr("wccaf-mandatory") == "yes" ) {	
          							if( $("input[name="+ field.attr("name") +"]").is(':checked') ) {
          								field.parent().find("span.wccaf-validation-message").css("display", "block");
          							} else {
          								wccaf_is_valid = false;
          								field.parent().find("span.wccaf-validation-message").hide();
          							}	 
          						}
          					}
          				}				
          				function doPatterns( patt, val ){
          					var pattern = {
          						mandatory	: /\S/, 
          						number		: /^\d*$/,
          						email		: /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i,	      	
          					};			    
          				    return pattern[ patt ].test(val);	
          				}
          			});	
          		})(jQuery);
          	</script>		
          	<?php 
          }
          

          Note: our upcoming release V2.0.0 has some major changes, I will update this comment once that released.

          1. Alban November 24, 2017

            Hi Saravana,
            i made the callback as you show me and i put my slug int the require place of your code.
            I only see the javascript in my tab, so i inspect a little bit the code and i see that this filters return an empty array :
            $all_fields = apply_filters( ‘wcff/load/all_fields’, $post->ID, ‘wccaf’, “translation_product_data” );
            So no fields are injected.

            1. Alban November 24, 2017

              Ok i just fix my problem, it was on the filter add_filter(‘wcff/product/tabs’, ‘wcpb_add_custom_product_tab’); that i make a mistake in the slug tab, sorry. You can delete the two last message.
              Thanks for your very helpfull support.
              Great plugin !

              1. Saravana Kumar K November 24, 2017

                Glad to hear that. Please give your review at wordpress plugin page for WC Fields Factory, I would really appreciate it.

              2. Alban December 12, 2017

                Hum seems that the update broke something, i can’t see my custom tab in the select box (in your location section) 🙁

                1. Saravana Kumar K December 12, 2017

                  Hi, Yes it went in a major restructuring. for you here is the update.

                  function inject_admin_fields_on_custom_tab() {
                  	global $post;
                  	$is_colorpicker_there = false;
                  	$is_image_field_there = false;
                  	$all_fields = wcff()->dao->load_fields_for_product( $post->ID, 'wccaf', "your_tab_slug" );
                  	
                  	foreach ( $all_fields as $title => $fields ) {
                  		if( is_array($fields) &&  count( $fields ) > 0 ) {
                  			foreach ( $fields as $key => $field ) {
                  			
                  				$field["value"] = determine_admin_field_value($field, $post->ID);
                  				$field["location"] = "your_tab_slug";
                  				
                  				/*
                  				 * This is not necessary here, but variation fields have some issues, so we have to do this in all places
                  				 * Since CSS class name connot contains special characters especially [ ] */
                  				if ($field["type"] == "datepicker" || $field["type"] == "colorpicker") {
                  					$field["admin_class"] = $field["name"];
                  				}
                  				
                  				do_action( 'wccaf_before_field_start', $field );
                  				
                  				/* generate html for wccaf fields */
                  				echo wcff()->builder->build_admin_field($field);
                  				
                  				do_action( 'wccaf_after_field_end', $field );
                  				
                  			}
                  		}
                  	}
                  	
                  	/* Don't forget to include this function as well - (There is no change in that) */
                  	wccaf_fields_validation_for_custom_tab();
                  	
                  }
                  
                  function determine_admin_field_value($_meta, $_id = 0) {
                  	$mval = false;	
                  	if (metadata_exists("post", $_id, "wccaf_". $_meta["name"])) {
                  		/* Well get the value */
                  		$mval = get_post_meta($_id, "wccaf_". $_meta["name"], true);
                  		/* Incase of checkbox - the values has to be deserialzed as Array */
                  		if ($_meta["type"] == "checkbox" && is_string($mval)) {
                  			$mval = explode(',', $mval);
                  		}
                  	} else {
                  		/* This will make sure the following section fill with default value instead */
                  		$mval = false;
                  	}	
                  	/* We can trust this since we never use boolean value for any meta
                  	 * instead we use 'yes' or 'no' values */
                  	if ($mval == false) {
                  		/* Value is not there - probably this field is not yet saved */
                  		if ($_meta["type"] == "checkbox") {
                  			$d_choices = array();
                  			if (is_array($_meta["default_value"])) {
                  				$d_choices = $_meta["default_value"];
                  			} else {
                  				if ($_meta["default_value"] != "") {
                  					$choices = explode(";", $_meta["default_value"]);
                  					foreach ($choices as $choice) {
                  						$d_value = explode("|", $choice);
                  						$d_choices[] = $d_value[0];
                  					}
                  				}
                  			}
                  			$mval = $d_choices;
                  		} else if ($_meta["type"] == "radio" || $_meta["type"] == "select") {
                  			$mval = "";
                  			if ($_meta["default_value"] != "") {
                  				$d_value = explode("|", $_meta["default_value"]);
                  				$mval = $d_value[0];
                  			}
                  		} else {
                  			/* For rest of the fields - no problem */
                  			$mval = isset($_meta["default_value"]) ? $_meta["default_value"] : "";
                  		}
                  	}
                  	return $mval;
                  }
                  
                  1. Alban December 13, 2017

                    Thanks for the updated code, but i think the filter isn’t working too :
                    add_filter(‘wcff/product/tabs’, ‘wcpb_add_custom_product_tab’);
                    Have you change its name ?

                    1. Saravana Kumar K December 13, 2017

                      Use this instead add_filter(‘wcff_product_tabs’, ‘wcpb_add_custom_product_tab’);

                      From Version 2.0.0, I Replaced all “/” with “_” on WC Fields Factory related actions and filters ( I did mentioned in the release note as well 🙂 )

  8. Charles November 20, 2017

    Hi,
    I can’t make run normaly the checkbox and I didn’t undertand how they work, it’s really weird, they seems to be linked even if there are not in the same admin field group. I use your plugin on latest WP and WC versions.
    Could you please help me ?

    1. Saravana Kumar K November 21, 2017

      I am not sure I understand it correctly, but check box group always considered as a single entity, if you have checkbox field with 5 options, then it will be added as cart (as well as order meta) meta a comma separated values.

      1. Charles November 23, 2017

        Hi, thank you for the answer.
        It’s not linked to the groupes because when I create two differents fields in the same admin panel of a product but not in the same admin groups, the problem return. This happens when I check, update the data, uncheck some checkboxes and update again the data.

        1. Saravana Kumar K November 23, 2017

          Oh, that is a problem, since I trust you guys that you won’t create two fields on different Fields Groups with the same name. that’s why I didn’t maintain the namespace between each groups. anyway I think I should, at least we can prefix all fields name with the Fields Group post’s ID.

  9. Trinitech November 1, 2017

    Hi, thanks for the great plugin! However, we are unable to see our custom field in the order meta. We have made an admin field, added a value, made it visible in the cart process and selected ‘Add as Order Meta’ but the data is not visible in the order meta data. It is also not being passed to our payment system Stripe. We are using latest WP and WC – could there be a compatibility problem? Thanks.

    1. Saravana Kumar K November 1, 2017

      Hi,

      Does it carried it to Cart & Checkout page.?

      It only not added in the Order.?

  10. Fendi October 8, 2017

    Hi there, I added a custom field “UPC code” for my products to be displayed in Simple product and Variable Products. For the Custom field for Simple product it works fine, but once I use it for Variable Products, it doesn’t display the UPC code at all and instead it displays the text “Array”. I have all the settings same as the simple product; therefore, not sure what I can do to display difference UPC code for different variations of my products. Great plugin btw! Thanks.

  11. Jai September 12, 2017

    Hi, I created a product field (Radio Button) and selected Add meta data. Now where can I see what option user has choosen?

  12. Jeff September 5, 2017

    I want to add a field to each product that would display which of our suppliers we purchase the product from. This could be a drop down type of field. Will this plug in do that? Thank you. Jeff

    1. Jeff September 5, 2017

      Addendum to previous comment. I want this field to be displayed in the admin order information, but not on the front end order or the order confirmation email. This is only for internal order processing use.

  13. dgweb September 1, 2017

    How to Get Fields data in custom page

  14. Makis August 25, 2017

    I can’t find an option to add custom tab in WC group so I create one in functions.php. The problem is that It is not visible in locations section. Is it possible to fix it or add an option to create new tab?

  15. Stretch August 15, 2017

    Great plugin, thank you.

    I am now using on my second site and am trying to add custom fields to product tab in admin, but I can not select the custom tabs I have created.

    I have used the following to create the tab(s)

    add_filter( 'woocommerce_product_data_tabs', 'add_boat_details_product_data_tab' , 99 , 1 );
    function add_boat_details_product_data_tab( $product_data_tabs ) {
        $product_data_tabs['boat-details'] = array(
            'label' => __( 'Boat Details', 'cbm' ),
            'target' => 'boat_details_product_data',
            'class' => array( 'show_if_simple'),
    		'priority' 	=> 100,
        );
    
        return $product_data_tabs;
    }
  16. Anthony August 12, 2017

    Hi, I have created a custom field for every variations. How do I make it appear on the shop page, particularly replacing the product image.
    Thanks for the great work!

  17. Vitaly Kolesnik August 12, 2017

    Hi! Thank you for this excellent plugin.
    I have a question: I have a datepicker field set up as Admin Field. Is there a way to display this field (with a datepicker) inside an order edit page? The shop is offering events and the shop manager should add the event’s date to a received order.

  18. GreenChris August 3, 2017

    Hi There,
    How to record in a “Formidable Form” an Admin Field ?
    I use WC Fields Factory with Woocommerce for products.
    I need to record my WCFF named “client_id” from a product to an Formidable Form (as feedback about product)
    I have tried [wwcaf_client_id] but it doesn’t work ;-(
    Thanks for your help
    Best Regards

  19. Bruce June 17, 2017

    Love this plugin! Is there a way to copy admin field groups? I have tons of fields within one admin group, and its a nightmare to try to redo all of those (with few more fields I need to add). Any advice on this is greatly appreciated!

  20. Bruce H. June 7, 2017

    Hi and thank you for the wonderful plugin. I am hopeful this will make the custom site we are working on alot smoother. One issue I am running into is I have created a set of ADMIN FIELDS, flagged accordingly for only products within a given category to show fields in admin, edited products and added values to those fields (works great), but even with the “show on product page” option selected, they dont display. How can I get this data to display?

    1. Bruce June 17, 2017

      NOTE: This one was specifically the IMAGE field type which isnt showing on front end.

  21. Dayna May 31, 2017

    I see the admin fields on the product page, but how can I display the name of the admin field group?
    Thank you!

  22. Samuel Drew May 28, 2017

    I’m beginning to think that this plugin no longer works. I want to add a custom field that we use internally, entering the value on the product page in the dashboard so that it displays on the order page in the dashboard and so we can include it in any emails that are sent. I add an admin field with the option set to post as order meta, but, not only does the value not get posted to the order, the custom field name isn’t even listed. I have tried numerous option combinations, but none of them work.

  23. Francisco Simões May 20, 2017

    Hi Saravana,
    Thanks for the great plugin.

    I think I’ve encountered a problem with your plugin, or I do not understand how it should work.

    When creating a field with “WC Admin Field”, I hoped that after configuring it, it could have a field: visible to the client from request to completion, and that the field be read-only and visible on all screens.

    The settings of the main parameters are as follows:
    Requerid: (no);
    Show on Product Page: (Show in Product Page);
    Show on Cart & Checkout: (Show in Cart & Checkout Page);
    Order Item Meta: (Add as Order Meta);
    Show login user only: (Yes);
    Editable: (No);
    Read Only: (Show as Read Only);
    Value or Field: (Field);

    Result: the field is visible in the “order” and remains “Read Only”, but does not appear in the others until finalization.

    On the other hand, if I put the parameter “Read Only” with “Show as Normal”, the field is visible on all screens, and editable in the “order” screen for the client.

    I ask: If you set the “Read Only” parameter to “(Show as Read Only)” the field would not be editable in the “order”, but would it be visible on all screens? If so, this is not happening.

    wordpress: 4.7.5
    woocommerce: 2.6.14
    WC Fields Factory1.3.8

    Tks!

  24. Pascal Schaible April 19, 2017

    Hi.
    I know this is a little bit old, but is it possible to show fields factory fields where you make a manual order? This would be great to know.

  25. SWComm April 7, 2017

    Hi – so far, your plugin is doing what I need it to do, thank you! Is there a recommended way of adding tinymce for admin field textboxes? I have products with a number of custom fields, some of which require formatting. Thanks in advance for any advice.

  26. GlazerGallery April 6, 2017

    It doesn’t seem to be working with WooCommerce 3.0

  27. Jiri Havel March 22, 2017

    Hi Saravana, how to get the admin field to the shop page under the price?
    Thank you
    Jiri

  28. Josiah Williams March 21, 2017

    Hi, I need to group my admin fields so that I can add a conditional to hide/show when another field is checked. Currently the fields are rendered as separate tags and not grouped by a div. Do you have any solutions/ideas to accomplish this?

  29. Gerardo Subrizio March 17, 2017

    Hello Saravana,

    thanks for your plugin! I’m trying to setup an admin field which is an image and I would like to view it into the product page.
    So far no luck. It seems that everything you said above works except for images……:-(

  30. Jaak Ivask March 17, 2017

    Hello,

    Thank you for create plugin. Makes adding custom fields much more easier.

    But get into trouble.

    I have added new admin text field for EAN code (in WC admin it shows correctly and I can add value to this field)
    If I enable “Show on Product Page” it works as expected.

    If I enable “Show in Cart & Checkout PAge” and “Add as Order Meta” field isn’t shown in cart and in order. That missed?

  31. Halls March 8, 2017

    Hi,

    I’m using the plugin (v1.3.6) to create a text field for a variable product type in the Admin but I’m having problems displaying in the frontend.

    I’ve selected ‘Show in Product Page’ option, but whenever I hit the ‘Update’ but resets the option to ‘Hide in Product Page’.

    Can you please tell me what I’m doing wrong?

    Thanks.

  32. Prajakta February 23, 2017

    Thank for this plugin.
    I wanted to show some of the products as promotional products. So I have added a new field in General category of Simple product, using Admin Field Group.
    How can I show only promotional products on separate page?
    Also, Is it possible to show all products under category on Promotional Page?

  33. Sheraz February 3, 2017

    Thanks a lot plugin creator, your forum and plugin helped me alot.

  34. dush88gs January 30, 2017

    How can I send custom Admin field only to admin email address and make it not sent to customer email address. What I want is to disable that field from showing in customer email. please reply. thanks in advance.

    1. dush88gs February 6, 2017

      If you know the solution kindly reply soon. This is very urgent. thank you…

    2. LiewzY April 1, 2017

      I’m also interested to know

  35. Javier Freire January 26, 2017

    Hello
    I try to import csv to products, but it does not allow me to do, to fields created with “Custom Fields” in “Admin Fields”. Is there any way to do it.

  36. Vizal January 13, 2017

    Hello I am not getting image from admin side to show on single product page. I have added $transImage_val = get_post_meta( $ProductIDTr, “wccaf_3d_image”, true );, I am getting perfect ID for $ProductIDTr but not getting image for that. Reply me as soon as possible.

  37. Vizal January 7, 2017

    It was very helpful, But I would like to know that can I change the formula as per my convenience? e.g. [width x length / 144 x grade x depth] , – I want to use this formula then how can I do?? As in this “grade” will also change from the user side from drop down selection. And also I would like to give selection for parameter like cm, inch etc from user side for width, length and depth. And also like to know that is it possible that price will be change as per the drop-down selection of parameters which in formula at user side.

  38. Berto December 22, 2016

    Hi, you make a great plugin..Thanks!!
    I have a doubt:
    How can I put my custom fields in the Description tab of a product?
    What difference has between Products Fields and Admin Fields?

    Thanks!!

  39. Sam December 16, 2016

    Hi Saravana,
    First of all Thank you somuch for such a great plugin.
    I will be very thankful to you if you can help me here or can provide any other solution.
    I am not able to show the value of admin-custom-field in customer-on-hold-order mail.
    What i want is: if we add any product in the admin with the value of custom field then this value should show in customer-on-hold-order mail.
    What i did is : first i added a new custom field(save_amount) in WC Admin Field Groups, which is showing for every product i added in the admin.
    Now i added following code to customer-on-hold-order.php
    echo get_post_meta($values[“product_id”], ‘save_amount’, true);

    but it is not working; value of save_amount is not showing in any customer-on-hold-order mail.

    Thanks

  40. Stephen December 8, 2016

    Hi. I am trying to add a admin custom field to ISBN nr on products, I have created a admin custom field form so the admin can add the number but it does not display the result in the front end, but rather a text input field, how do I get the ISBN number added in the product to rather display? I love the concept of this plugin, just a little confused thanks!

    1. Stephen December 8, 2016

      I got it working 🙂

  41. guy November 23, 2016

    i have a problem with getting or showing a date field

  42. Flash72 November 9, 2016

    It seems I can not have more than one admin image field. If I have two I can set one to an image with no problem but setting the second one does not save the selection for that field but it does change the selection for the first image to the image selected for the second.

  43. Adam November 8, 2016

    Hi, I am having problems getting an admin order fields to display in the order meta data. I have enabled the order meta for the fields in question but they are not displaying, not sure if I am doing something wrong?

  44. Claudia November 7, 2016

    Hi, I wanna know if I can insert information in html, because I wanna insert the packing information of my products in a table
    thank you

  45. Claudia November 7, 2016

    I want insert in the field created a table in html code, but I can’t, How can I do that
    thank you

  46. zobor September 20, 2016

    Hi Saravana!

    You wrote a great plugin!

    I only use admin fields, to make stock2 and stock3 for products (stock1 is the standard woocommerce stock).
    Customers only see the stock1. When a product decreased under 10, low stock notification is sent to admin, then he can increase stock 1 manually from stock 2 or stock 3. Is there a way that i can make it automatic?
    I think i could use ‘woocommerce_low_stock’ action hook in function.php to make this. how can i get stock2 and then increase stock1? (stock1 can’t be higher then 30, if stock 2 is less ten 20, stock 1 will be less then 30, otherwise stock1 will be 30, stock2=stock2-20)
    I would like to make it to work with every single product, that everytime stock decreased under 10, this action should run and change the stock.
    Can you help me with this?

    Best Regards,
    zobor

  47. Helmar Rudolph September 19, 2016

    Dear Saravana,

    If I want to display an admin field in the order email only, what do I need to set in the field settings?

    Great plugin, BTW!

  48. Marcin September 18, 2016

    The image upload admin field is being reset when a product is edited. Even a simple one word change in product description causes the image uploaded using image upload admin field to disappear. Is there a fix for that?

    1. Saravana Kumar K September 18, 2016

      Hi, thanks for reporting, yes that bug was there, will release the fix ASAP.

  49. Michela September 13, 2016

    hi, can I show custom fields only in cart and not on product page by product category?

  50. Leo August 31, 2016

    Can this get_post_meta code work for non-admin custom fields?

  51. Radhey Shyam Sharma August 22, 2016

    WC Product Field Groups fields showing on product page but not save so not showing in cart,checkout, order meta

    1. Saravana Kumar K August 25, 2016

      Hi, have you enabled Show On Cart & Checkout and Order Meta options for each fields

  52. SC August 10, 2016

    /* Variable id */
    $my_admin_field_val = get_post_meta( $variable_id, “wccaf_your_admin_field_name”, true );
    The above isn’t working. I’ve checked my database and my custom fields in variations are being saved but i can’t echo them.
    When i try it just echos the sku. I do have it working on a simple product but can’t get it to work for a variable product.

  53. james July 17, 2016

    Hi, i have a problem with a select field.
    how can i get the value of a select field on front end? because i don`t know how to access to the value selected in de admin page.
    i created a custom field who is displayed when a new post is created, but how can i get the value selected in the front page?
    for example:
    house | New houses , i need the value New houses not the key house;

  54. Stacey June 16, 2016

    Hi Saravana, Thank you very much for the code to put in my functions.php

    I copied this code and changed the “wccaf_your_admin_field_name” to “wccaf_url_wrapping” (which was the admin field name) however processing a test order it did not show me this field on the ‘edit order screen’ after checking out.

    Have I missed a step to make this work? Can I send you screen captures to show you what is happening? I am currently testing this on a Local dev site.
    Look forward to hearing from you.
    Kind Regards
    Stacey

    1. Saravana Kumar K June 16, 2016

      My bad, there was a bug on my snippet, I have updated it now, please update it on your functions.php and test it again.

      Previously

      $my_admin_field_val = get_post_meta( $post->ID, "wccaf_your_admin_field_name", true );
      

      Now it has been updated to

      $my_admin_field_val = get_post_meta( $values["product_id"], "wccaf_your_admin_field_name", true );
      
  55. Stacey June 15, 2016

    Hi, Thank you for a great plugin. I have managed to create the fields in the product admin page but I have not been able to get it to show in the order admin page or on the admin email once the order has been placed and processing. From what I am reading I need to use this snippet?

    $my_admin_field_val = get_post_meta( $post->ID, "wccaf_your_admin_field_name", true );
    

    I just don’t know where or how I should use it.

    I would be so grateful if you could give me a little insight into how to get my new custom field into the admin order screen.

    1. Saravana Kumar K June 15, 2016

      Hi,

      Put the below snippet on your theme’s functions.php

      function save_admin_field_order_meta( $item_id, $values, $cart_item_key ) {
      	if( isset( $values["product_id"] ) ) {
      		/* "your_admin_field_name" that should be your admin fields name not the label.
      		 *  Also don't remove the "wccaf_" prefix from your custom fields key */
      		$my_admin_field_val = get_post_meta( $values["product_id"], "wccaf_your_admin_field_name", true );
      		
      		if( $my_admin_field_val && $my_admin_field_val != "" ) {
      			wc_add_order_item_meta( $item_id, "Give a Label", $my_admin_field_val );
      		}
      	}
      }
      
      add_action( 'woocommerce_add_order_item_meta', 'save_admin_field_order_meta', 99, 3 );
      
  56. tanm May 6, 2016

    Hi Saravana,
    Thanks for the great plugin.
    I want to implement multiple date select in my product admin page.
    I am using Keith-Wood’s jQuery Datepicker plugin, enqueue in my functions.php
    Tested ok on product page, but not working on admin page.
    How do I accomplished ?
    Thanks in advance.

    1. Saravana Kumar K May 13, 2016

      Hi, I have replied for the same query you have asked in the wordpress forum, please refer there.

  57. alireza May 3, 2016

    Hi there. i have a problem with your plugin. it works great but i need to type the Field Label in arabic but when i do that, the Field Name become empty, so if you change it to a non-read only field, i can put an english name for Field Name to work with Data base. oh, i forgot to say that when Field Name is empty, whatever you put on this field for a product, does not save. and show an empty field.

    Secondly can you help me how to change the place of an admin field in frontend to a place like additional information tab or…

    thanks

    1. Saravana Kumar K May 13, 2016

      Hi, please update to V 1.3.4 , it has the fix for this issue.

      You can place the custo fields group to wherever you want, please use the Fields Factory -> Settings page for that.

  58. ashhar April 12, 2016

    Hi Saravana Kumar, I create a date field, “Isbn”, in admin field. I need to display it as readable only on product page in front end so what i can i do…???

    1. Saravana Kumar K April 25, 2016

      Hi, this feature is available with V1.3.1, please update your WC Fields Factory installation.

  59. Adnan April 5, 2016

    Hi Saravana Kumar, I created my admin fields to enter my data in woo commerce add products page but the data is not stored in the database and also not showing on the frontend product detail page.

    1. Saravana Kumar K April 6, 2016

      Hi Adnan, There was an error on my post ( it’s been updated now ). aall custom meta stored by Admin Fields will have their keys prefixed with wccaf_.

      So to access your admin custom fields use the following snippet

      $my_admin_field_val = get_post_meta( $post->ID, "wccaf_your_admin_field_name", true );
      

      Also displaying admin fields on product page ( front end ) support is not yet added, I will added with my next release.

  60. Hammer April 5, 2016

    Hi,

    I create a date field, “product_date”, in admin field. I need to display it as readable only on product page. I am trying to get this admin value in wcff-datepicker.php using

    echo get_post_meta(get_post()->ID, "product_date", true );  
    

    but it returns blank.

    Any idea?

    Regards
    Hammer

    1. Saravana Kumar K April 6, 2016

      Hi Hammer, sorry there was a typo in my post ( updated now )

      all custom meta stored by Admin Fields will have their keys prefixed with wccaf_
      So to access your admin custom fields use the following snippet

      echo get_post_meta(get_post()->ID, "wccaf_product_date", true );
      
  61. Christine Gibbons March 24, 2016

    Hi

    I have got to step 5 ok but how do I get the information to appear on the product website page. Do I need to add the code above somewhere?

    Thanks

    1. Saravana Kumar K April 1, 2016

      Hi, for this you will have to create Product Fields instead of Admin Fields