We compared Gravity Forms and Formidable Pro, and one of our readers requested a tutorial on creating products via submitted forms with Formidable Pro. The ability to create Custom Post Types (CPTs) with Formidable Pro is one of my favorite features, so here we are: How to use Formidable Pro to create products via forms.
I’m going to use WooCommerce in this example, but you can create products via submitted forms with almost any eCommerce plugin, as most all of them use CPTs for products. This is really handy if you allow 3rd party vendors to submit and list products in your store.
Before we start adding things and creating forms, let’s think about what fields we’ll need to create our products. This may be different based on your shop, but most simple products will need a few basic things:
- Product Name
- Product Description
- Regular Price
- Product Category
- Product Tag
- Featured Image
Again, not every store needs each of these, but this is probably a good place to start. You may need to adjust your fields for other product types. Here are some other fields I’d consider depending on your shop setup:
- Product SKU
- Sale Price
- Shipping dimensions
- Additional images
- Short description / excerpt
You also may need the vendor name and email address for your own records or to get more information. If you’re paying out vendors via PayPal, you may need a PayPal email address (many people, including myself, use a different email for this).
Once you have an idea of all of the fields you’ll need to have for product creation, we can then move on to building our form and including these fields, then mapping them to the appropriate fields on our product. I’m going to use a simple product in this example as it’s pretty easy to understand. Creating forms for variable product submission or other really detailed product submissions is something that requires a bit more knowledge of WooCommerce to set up, and may not be as applicable to other plugins.
Now that we know what we’re doing, let’s create a new form for our simple product submission. I’d start with a blank form if I were you rather than a template.
Here’s what I’m using for my fields and the associated inputs:
- Product Name – Single Text
- Description – Paragraph Text
- Short Description – Paragraph Text
- Product Price – Number*
- Featured Image – File Upload
- Vendor name – Single Text
- Vendor email – Email Address
*When you set up a number field, you can determine a minimum and maximum value, as well as a “step” (increment) under “Number Range”. I set my step to 0.01 so that if people use the up / down arrow for this, it increments by cents.
Obviously you may need more fields, but this will work to start. Don’t worry about creating fields for product categories or tags, as we’ll be able to automatically add them later with a couple of clicks
Now that we’ve got the form fields added, we can begin to map these fields to our product fields.
Once your fields have been created, you can map them to the product fields so that submitting a form will create a new product. Click “Create”, “Update”, or go to the form settings. You can set up any general settings for your field as necessary, but we’re most interested in the tab called Create Posts. Here you’ll want to enable the setting that says, “Create a WordPress post, page, or custom post type with this form.”
Under this tab, we’ll need to map our form fields to the appropriate data. Here are the settings I’ve changed or created:
- Post Type: Products
- Post Title: “Product Name” field
- Post Content: “Product Description” field
- Excerpt: “Short Description” field
- Post Password: none
- Slug: Automatically Generate from Post Title
- Post Date: Use the Date Published
- Post Status: Create Draft
Now we’re ready to add in our product categories and tags. Keep scrolling down and you’ll see a setting for this and custom fields as well. We’ll want to add our categories and tags as new checkbox fields. We could add product type as well, but since we’ll only be creating simple products (the default type), this won’t be necessary.
As a note for advanced users that want to accept all sorts of product submissions, you could add the product type field as a new checkbox, then edit it to become a dropdown or radio button so only one selection is allowed. You could also then base some conditional logic around this (such as showing fields to enter variations if a variable product is selected, etc). However, thats a bit more involved than what we’re doing here 🙂 .
Also note in my screenshot that we’re going to add some custom fields. I want my image to be set as the featured image, so I’ll map that field to the
_thumbnail_id. We’ll also want to map our price to a custom field, so we’ll have to add another field and click “Enter New” since the price meta key is not available to select. When you click “Enter New”, enter
_regular_price, then map that to your form’s product price field.
If you’re allowing for a regular price and sale price in your form, you could do the same thing with the
_sale_price meta key.
If you do want to add more fields, such as SKU fields, I’d recommend checking out this helpful list of WooCommerce form fields that a Formidable Pro user posted. You can also dig through the WooCommerce product meta keys to find the ones that you need.
Last step! Don’t forget to display your form on a post or page so that vendors or anyone submitting a product can access it. You can use the “Add Form” button to do so, which will insert a Formidable shortcode like this:
[formidable id=7 title=true description=true].
Now anyone can submit a form to create a WooCommerce product! Don’t forget to include fields for the vendor’s information in case you have questions or are using a plugin to track sales for your vendors.
There’s only one minor hiccup with our form. If you view your products list, you’ll notice that a form submission successfully creates a new product, but it appears that the product does not have a price:
That’s because our form is using the
_regular_price meta key, but the product list uses the
_price meta key. We can’t use our form’s “Price” field for two custom fields / meta keys, so we can’t use it for
_regular_price. However, we do not want to change this. If you view the product page, the regular price is there:
When you click “Save Draft” or “Publish”, the
_price meta will be set. You’ll now see this displayed in your products list:
If you originally used
_price instead of
_regular_price in the form, this would be displayed in the products list, but then you’d have to remember to enter it yourself on the product page before saving or updating the product. You could use fields for both in your form if desired, but that may confuse merchants when they use the form, as they’d have to enter price twice. It’s up to you how you’d like to handle this though 🙂 .
That’s all there is to it! Your shiny new form will allow vendors to submit products to your shop externally for you to review and publish as you choose.