How to Create WooCommerce Products with Gravity Forms (2024)

How to Create WooCommerce Products with Gravity Forms (1)Scott Ryer

/Updated August 17, 2023 /30 Comments

How to Create WooCommerce Products with Gravity Forms (2)

Editor’s note: This article is about creating WooCommerce products using the Advanced Post Creation Add-on. If you’re looking for a native Gravity Forms & WooCommerce integration, check out Gravity Shop Product Configurator, which lets you embed Gravity Forms inside WooCommerce products.

Did you know that the Gravity Forms Advanced Post Creation Add-On can create WooCommerce Products? It opens up a whole world of possibilities where users can create products completely on the front end.

For example, you can create your own marketplace specific to vendors in your niche, like a focused version of Etsy. Those vendors can add new products using your form.

In this tutorial, our niche is stickers, and the form we’re going to build lets users add their own stickers for sale on our site, but we’ve seen this on sites that sell music, art prints, stock photos, and more.

  1. Getting Started
  2. WooCommerce Products
    1. Required Fields
    2. Optional Fields
  3. Creating Products with Gravity Forms
    1. Step 1 – Add Your Fields
    2. Step 2 – Create APC Feed
    3. That’s It!
  4. Taking it Further
    1. Automatically Populate Categories and Tags
    2. Uploading to the WooCommerce Product Gallery
    3. Enhance File Upload Fields

Getting Started

In this tutorial, we’re going to do a deep dive on building a form that will create a WooCommerce Product on submission.

WooCommerce Products

WooCommerce stores a lot of data for each product, and before we can build a form that will create them, we need to first get an understanding of what kind of values we must pass to create a product and how those values are stored in the WordPress database.

Required Fields

The following fields are what I would consider the minimum to create a WooCommerce Product that can be sold in your store. Technically they aren’t all required, but from my experience excluding any of them will exclude sales.

  1. Name – The name of your Product, which also used for the Product slug.
  2. Description – The description displays on the Product page.
  3. Price – WooCommerce allows for two prices: regular price and sale price.
  4. Featured Image – The featured image is used extensively in a WooCommerce store. All products should have one.

Optional Fields

These next fields are optional, but are commonly used with WC Products.

  1. Category – Similar to WordPress Post categories, this is the taxonomy for the Product.
  2. Tags – SEO tags to increase Product visibility in searches.
  3. SKU – If you track inventory, unique Stock Keeping Units are attached to all Products. It’s located under the Inventory tab.
  4. Weight – Product weight is used to determine shipping costs. Find it in the Shipping tab.
  5. Product Gallery – On top of the Featured Image, Products can contain galleries that are displayed on the Product page.

Creating Products with Gravity Forms

With a solid understanding of WooCommerce Products, we’re ready to build a form that will create new Products. Let’s get started.

Step 1 – Add Your Fields

We’re going to add all of the fields from above to our form because I like building ambitious forms. Here’s a breakdown of how I have set up my form:

  • For Product Name, Regular Price, Weight, and SKU we’ll add a Single Line Text field.
  • Add a Paragraph field for the Product Description so the user has a little more room.
  • Featured Image and Gallery require File Upload fields.
  • Just like other WordPress Posts, WooCommerce Products support multiple categories, so I recommend a Checkbox field for adding categories to your Product.

Below is the entire form with all the fields added.

Uploading galleries requires GF Media Library. See Uploading to the WooCommerce Product Gallery below.

GF File Upload Pro

Enhance File Upload fields with image previews, cropping, and more using Gravity Forms File Upload Pro.

Get File Upload Pro

Step 2 – Create APC Feed

With the fields in place, it’s time to create an Advanced Post Creation feed and map the fields to the WooCommerce fields.

Give your Feed a Name and set the Post Type to Product.

Under Post Content, we’ll map most of our fields. The APC Add-On automatically supports standard Post fields, but WooCommerce has some custom fields that need to be mapped manually. We’ll start with the supported fields.

Title, Content, and Featured Image are simple to map. Simply select the merge tag for Title and Content that matches your Name and Product Description fields. For Featured Image, select your appropriately named File Upload field.

To map a field to the Product Short Description, add this snippet to your theme’s functions.php file.

For Gallery, Price, Weight, and SKU, we’ll need to manually map the fields. To do this, select Add New Custom Field Name at the bottom of the Select Custom Field Name Drop Down. Then, type in each of the appropriate field types. Note the leading underscore; this is required.

WooCommerce requires both _regular_price and _price to have a value. If you omit either one, the price won’t appear on the Product page.

Here’s a reference for easy copy/pasting of the field names:

_product_image_gallery_regular_price_price_weight_sku

Under Taxonomies you can map the Categories field. You can also map to any additional taxonomies, such as Tags or custom WC Taxonomies.

That’s It!

With those two steps completed, you’re all set to create WooCommerce Products with your form. Give it a spin and you’ll be generating Products in no time.

Taking it Further

Automatically Populate Categories and Tags

Use GF Populate Anything to automatically populate Categories and Tags into Checkbox fields. Populate Taxonomy Term and set the Filter and Choice Template according to this screenshot.

Uploading to the WooCommerce Product Gallery

Use GF Media Library to upload images to the WooCommerce Image Gallery. Simply check the Upload to Media Library option and map the field as shown in Step 2.

Enhance File Upload Fields

Use GF File Upload Pro to add image previews, cropping, maximum file size limits, real-time upload validation, and more to Multi-File Upload fields.

Managing physical products? Check out GP QR code.
Gravity Forms QR Code can help you bridge the physical and digital world. Generate QR codes from Gravity Forms field values, or scan QR codes to insert values into Gravity Forms fields. Learn more about Gravity Forms QR Code.

Did this resource help you do something awesome with Gravity Forms?

Then you'll absolutely love Gravity Perks; a suite of 47+ essential add-ons for Gravity Forms with support you can count on.

View All PerksBuy Now

Tags: GP Media Library, gp populate anything, post creation, woocommerce

  1. How to Create WooCommerce Products with Gravity Forms (13)

    James HelmsJune 15, 2023 at 10:45 am

    Thank you for this tutorial.

    Is it possible to create an form submission action that after the product is created it redirect the user to the new product, or possibly another page?

    Reply

    1. How to Create WooCommerce Products with Gravity Forms (16)

      James HelmsJune 15, 2023 at 1:10 pm

      I am also curious how I find the other post content, or custom field names/values?

      For example, if I want to set products to Virtual or Downloadable, how would I find those types of things?

      Thank you,James

    2. How to Create WooCommerce Products with Gravity Forms (17)

      James HelmsJune 15, 2023 at 1:12 pm

      Thanks for the reply to my first question Scott. Going to test it out now.

      • James
    3. How to Create WooCommerce Products with Gravity Forms (18)

      Scott RyerStaffJune 15, 2023 at 3:04 pm

      WooCommerce stores those attributes in the postmeta database table. For example, the Downloadable attribute is stored with the _downloadable meta key. It accepts the meta values of no and yes. Virtual uses a similar key _virtual and accepts the same meta values.

    4. How to Create WooCommerce Products with Gravity Forms (19)

      James HelmsJune 15, 2023 at 3:24 pm

      Thank you Scott.

      So you are referencing the tables in the database to get the id/name and then you are also using that to get the value? If so, I can see what you see.

      Oddly, when I created a product and assigned it as a Virtual Product it worked perfectly, until I edited the product from the backend, then I noticed the Virtual Option was no longer selected.

      Either way this is awesome and I really do appreciate the tutorial.

    5. How to Create WooCommerce Products with Gravity Forms (20)

      James HelmsJune 15, 2023 at 3:37 pm

      Scott, are you able to update other Database Table data? For example, I want to also add the Short Description which is in the “posts” database table and would be the post_excerpt data.

      I tried to do it, but it didn’t carry over.

      James

    6. How to Create WooCommerce Products with Gravity Forms (21)

      Samuel BassahStaffJune 16, 2023 at 6:23 am

      Hi James,

      You can use this filter hook to make the Post excerpt field available in the Post Creation feed.

      Best,

    7. How to Create WooCommerce Products with Gravity Forms (22)

      James HelmsJune 19, 2023 at 8:16 am

      Thank you Samuel, that worked perfectly.

    8. How to Create WooCommerce Products with Gravity Forms (23)

      Samuel BassahStaffJune 19, 2023 at 12:52 pm

      Hi James,

      You’re welcome. Glad it worked for you.

      Best,

  2. How to Create WooCommerce Products with Gravity Forms (24)

    NahuelMarch 1, 2023 at 10:11 am

    Good morning !

    I wanted to ask, is it possible to add with this plugin WooCommerce product attributes ? Because I do not see this option. I can add taxonomies like: categories and tags, but I can’t find the way to add woocommerce product attributes.

    Is there a way to add these attributes ?

    I am waiting for the answer.

    Reply

    1. How to Create WooCommerce Products with Gravity Forms (25)

      Samuel BassahStaffMarch 1, 2023 at 12:45 pm

      Hi Nahuel,

      Setting the Product Attributes doesn’t appear possible with the Post Creation Addon. You can contact Gravity Forms Support to see if they have a way to get this done.

      Best,

  3. How to Create WooCommerce Products with Gravity Forms (26)

    Austen OsborneFebruary 1, 2023 at 4:50 pm

    This works like a charm when making a woo product. However, when I print the array of meta saved by this process (I know this is more to do with GF’s APC addon), there are only a handful there.

    If I then load the WP admin page for this new product and simply hit Update without changing anything, loads more are added.

    How can I add in an action to do that update post action after the GF/GWiz form is processed?

    Cheers.

    Reply

    1. How to Create WooCommerce Products with Gravity Forms (27)

      Samuel BassahStaffFebruary 2, 2023 at 5:18 am

      Hi Austen,

      Just as you mentioned, this has more to do with how the GF APC addon creates the Woo Product. It may be possible with custom snippets, but we don’t have a solution. You can hire a developer to assist you with this. Here’s a list of Recommended Developers.

      Best,

  4. How to Create WooCommerce Products with Gravity Forms (28)

    Scot MacDonaldDecember 28, 2022 at 11:52 am

    Hi

    I realize this is an old thread but would appreciate some help.

    I’ve followed the instructions in order to map an external link but it doesn’t seem to work. In your reply above you refer to this field as “product type” but then say to map the “product tags” field. Should this not be the “product type” field? The only other thing I can see being the issue is perhaps I have the field values wrong in my form. Could you confirm the correct values (e.g is it “External/Affiliate product” or just “external”).

    Thanks

    Reply

    1. How to Create WooCommerce Products with Gravity Forms (29)

      Dario SpaceStaffDecember 28, 2022 at 12:21 pm

      Hi Scot,

      From what I understand, Scott’s reply here should do the trick: https://gravitywiz.com/how-to-create-woocommerce-products-with-gravity-forms/comment-page-1/#comment-628311. If you need further support and if you have an active Gravity Perks Advanced or Pro license, you can contact us via our support form.

      Best,

  5. How to Create WooCommerce Products with Gravity Forms (30)

    BenkyOctober 6, 2020 at 9:00 am

    Is it possible to use custom checkout links instead of having users use the normal woocommerce add to cart process for checking out?… I’m looking at something to allow vendors create products through the forms but redirect users to their Facebook or WhatsApp to complete an order

    Reply

    1. How to Create WooCommerce Products with Gravity Forms (31)

      Ryan DonovanOctober 6, 2020 at 10:36 am

      Hello Benky, You would be able to accomplish this when the user completes the entry within the confirmation page. What you could do is setup conditional logic on the checkout page that would dictate which confirmation page to take the user to depending on the selection on the form. 😃

  6. How to Create WooCommerce Products with Gravity Forms (32)

    XaviSeptember 23, 2020 at 6:21 pm

    Ray nuevanente muchas gracias, lo que no puedo poner las categorias cuando creo un producto es decir categorizar el producto de woocommerce no al crear un post, nuevamente muchas gracias

    Reply

  7. How to Create WooCommerce Products with Gravity Forms (33)

    XaviSeptember 23, 2020 at 1:58 pm

    Mil gracias por responder tan rapido pero no tengo muchos conocimientos, podrias darme unos pasos a seguir o si hay algun video tutorial te lo agradeceria mucho.Mil gracias Ryan

    Reply

  8. How to Create WooCommerce Products with Gravity Forms (35)

    ajrb98@gmail.comSeptember 23, 2020 at 8:33 am

    Hola, muy interesante todo y util, una pregunta como hago para poder incluir las categorias cuando sube el producto y los atributos.Muchas gracias

    Reply

    1. How to Create WooCommerce Products with Gravity Forms (36)

      Ryan DonovanSeptember 23, 2020 at 12:57 pm

      Hello, you will be adding these under Taxonomies. You can map the Categories field as well as any additional taxonomies, such as Tags or custom WC Taxonomies. 😀

  9. How to Create WooCommerce Products with Gravity Forms (37)

    CBAugust 18, 2020 at 1:17 pm

    I have questions similar to those posed by others…..

    Woocommerce has product data options of “Simple,” “Grouped,” “External / Affiliate,” and “Variable.” For “External,” one can also specify an external URL. (https://woocommerce.com/videos/woocommerce-external-affiliate-product-overview/)

    Is there a way to specify these values via Gravity Forms?

    Is there a way to also pass in a second description so that both a long and short description is passed?

    Reply

    1. How to Create WooCommerce Products with Gravity Forms (38)

      Scott RyerStaffAugust 18, 2020 at 2:49 pm

      Yep! You’ll need to add 2 new fields to the form:

      • Drop Down to select the Product Type. Make sure to set the values to match the meta stored in the wp_term_taxonomy table.
      • Single Line Text to insert the URL. I would use Conditional Logic to only show this field if the Drop Down is set to external.

      Then, in the APC feed, map the _product_url Custom Field to your Single Line Text field and map the the Tags Field Value to your Drop Down like this.

  10. How to Create WooCommerce Products with Gravity Forms (39)

    FernandoAugust 2, 2020 at 8:58 pm

    Hello!

    Is there a way to add a External/Affiliate and the URL to the product?

    Reply

    1. How to Create WooCommerce Products with Gravity Forms (40)

      Ryan DonovanAugust 3, 2020 at 12:25 pm

      Hello Fernando, I am not sure I follow. Could you please let us know a little more about your use case for this one? Thanks!

  11. How to Create WooCommerce Products with Gravity Forms (41)

    LeviMay 19, 2020 at 1:54 am

    WIll this work for product variations as well?

    Reply

    1. How to Create WooCommerce Products with Gravity Forms (42)

      Scott RyerStaffMay 19, 2020 at 11:10 am

      Variations and Attributes are not currently supported in the APC Add-On. You can map them under taxonomies, but it’s half-baked. The attribute gets added to the the wp_term_relationships table, but it doesn’t add the _product_attributes meta key in wp_post_meta.

      This is compounded by the fact that this isn’t a simple key; it’s stored in JSON similar to wp_attachment_metadata. Support needs to be added in the GF APC Add-On itself.

  12. How to Create WooCommerce Products with Gravity Forms (43)

    SushiMay 15, 2020 at 2:02 am

    Very interesting and helpful, thank you!I just wonder about how to add a field for “Product data” in order to let the submitter chose between “Simple Product”, “Download Product” or even other?I’d like to use the free “WP Crowdfunding” plugin in conjunction with WooCommerce, which creates a new campaign as a new product. WP-Crowdfunding also creates a new “Product data” type named “Crowdfunding”, which is important for displaying the campaign-related data such as “funding goal” or other typically Crowdfunding-related information.So how can I use this GF-Addon for creating a new campaign of a product-data-type “Crowdfunding”?

    Reply

Leave a Reply

How to Create WooCommerce Products with Gravity Forms (2024)

References

Top Articles
Latest Posts
Article information

Author: Aron Pacocha

Last Updated:

Views: 6172

Rating: 4.8 / 5 (48 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Aron Pacocha

Birthday: 1999-08-12

Address: 3808 Moen Corner, Gorczanyport, FL 67364-2074

Phone: +393457723392

Job: Retail Consultant

Hobby: Jewelry making, Cooking, Gaming, Reading, Juggling, Cabaret, Origami

Introduction: My name is Aron Pacocha, I am a happy, tasty, innocent, proud, talented, courageous, magnificent person who loves writing and wants to share my knowledge and understanding with you.