If you work with WordPress, you probably integrate forms into websites. Let’s face it. Form development can be simple or quite complex. My go-to form programs are Gravity Forms and Contact Form 7.
Last year, I worked on some very complex forms. Requirements included incorporating persistent data within multipart forms. For example, a user saves the form(s), continues to use the site, and add items to the form(s). Got it? Read on.
After initially trying custom functions and plugins (which didn’t work), I asked for help. I reached out to dozens, yes dozens, of developers via forums, e-mail, chat, help desks, support sites, and in person, and could not find a resolution. Then, during a random discussion at WordCamp US 2016, an alternate solution was suggested: WooCommerce. What?
Okay. So, hear me out. If Gravity Forms can be used to add products, why not use WooCommerce instead of a multipart form? Yes! Modify WooCommerce. A user can visit a page (product), and add it to the cart. The data is saved while the user continues to use the site. WooCommerce includes the required form fields: account, name, address, e-mail, payment options, terms, and more. Additionally, WooCommerce has many extensions, free and premium.
I’ve set up custom WooCommerce on several WordPress sites, duplicating files and editing them within the child theme. It’s possible to create functions, use alternate descriptive words (other than product), and hide certain fields. It works beautifully. And, if a simple form is still needed, Contact Form 7 does the trick.
Why did it take so long to find an answer? In short, the focus tends to be on a client’s request. If a client asks for a form, most developers will work on a form. Why did it take so long to share this information? Only recently have several peers shared similar opportunities with data persistence in forms.
Clients will ask for forms, but what do they really need? What will the form accomplish? If it involves persistent data, WooCommerce may just fit the bill.