Populate field after user fills but before submit?

Hello, I have made a form for product options, my concern is this: in the form I am asking for name and address as well as a few other pieces of info from user, I am asking for address because I don’t know his/her (name & address if new customer). This form will map to a custom PDF Template and fire an email to me only that’s essentially an order form for a vendor of mine (they like paper order forms).

So my question I guess is it better to have the customer fill in their (name & address on the product page) and then make them do it again on the checkout page? (don’t want customers getting annoyed) Or is there a way to maybe have the name and address hidden on the form and have those fields populated from the checkout page data? If so how would that be handled, plugin, code of some sort?

I am fairly new to using GF and not really a programmer/coder, but if told what to do I can put code where it needs to go. Thanks for reading and extending any help, greatly appreciated!

Following the process you’ve described you’re focused on creating the PDF from your template after completion of the Gravity Form. If your customer is redirected to the Checkout page at this point, with no ability to navigate away from the Checkout page, then the customer information could be passed to the checkout page using query strings and prepopulate the WooCommerce fields. If you want customers to be able to continue shopping or do anything besides checking out immediately, you would need to store the information in a cookie and retrieve it once they land on the checkout page.

Alternatively, and the approach I personally would take, you can create PDF’s from WooCommerce Orders when they are placed. I would build out a template there and have that attached to a notification email. Then you only need the customer details on the checkout page.

Tugmariner, thank you for the reply good points I hadn’t thought about. I have thought about your alternative, I’m just really not up on how to extract only the info I want from the product options, I mean I do that PDF now but the PDF I’m after is just a couple of the variations and the name and address and would like to get it to a custom PDF template. Any and all help is greatly appreciated!

Hi Erik,

Some of it is just rethinking what you want to accomplish and changing your search terms (in Google). I looked at this before responding previously, WooCommerce PDF Builder. Looks very customizable, so you could create an order form for the Vendor without divulging the details of what you’re charging, but I strongly suspect you would need the premium version to accomplish what you’re describing.


I’ll share what ever you need to see but essentially, I want a packing slip for the lack of a better term, but all I need is customer name and address and what options they want as far as colors go for their ear buds…right now I’m transcribing this info albeit it’s not a lot but it’s a pain, that’s why I’d rather port just this info out to a pdf template. I just don’t know how or what I’m looking for to extract just the info I need or how to code it.

Hi Erik,

Can you share a link to the form and I’ll take a closer look.

I can share the link to the page on the staging site, the form is 3 pages and I have it already mapped to a pdf template via E2PDF that fires off an email to me only and the result is what my vendor needs, it’s simple name, address and color choices. My quandary is that the user having to fill out address info then having to do it again at checkout, I would rather hide the address portion and have it filled when the user checks out (if it can be done) but also have the option to have it filled (still hidden) if the user is logged in (not sure how to do that but will figure it)

Being a registered, logged in, user changes things a bit. WooCommerce will populate checkout fields with user information by default. You can populate any Gravity Form fields with profile information using default values and merge tags.

Interesting. I assumed you were using GravityPDF. With the E2PDF plugin you’re using it indicates there is a WooCommerce extension so I would assume you could use the same PDF template but instead of tying it to the Gravity Form submission, tie it to the WooCommerce Order (which I assume has all of the information as in Gravity Form). Furthermore, a WooCommerce Order is a special type of WordPress post, so you could use the WordPress extension as well, although it may be a bit more convoluted and difficult to lay out (not sure, I’ve never used the E2PDF plugin).

That’s what I was thinking to use if (big if) customer is logged in.

Should I share the link to the form here?

You can share the link here or privately, whichever you prefer.

No, didn’t know they had something like it!! As I have said I am not a pgmr/coder so I am not sure on how things really work, I go by what I find in searches and what plugins will do it for me. So your saying Gravity PDF I can get granular fields and tie it to the order? How would I map the order fields (like the name and address) from the order? use pre_submit?

It’s a staging site and its not real pretty using it to test things like this!!

So your saying Gravity PDF I can get granular fields and tie it to the order? How would I map the order fields (like the name and address) from the order?

No, I’m saying it looks like the E2PDF plugin you indicate you’re using can tie to a Gravity Form, WordPress, or WooCommerce. Which means instead of using the Gravity Form data for your vendor order form you should be able to use the WooCommerce order. So you wouldn’t need to hassle yourself with where the customer enters their details.

Oh, ok so how do I tell the field to populate from an order that’s not complete yet? Also when does it populate? Sorry if I sound like a complete idiot, because I am a complete idiot!!

No, you ARE NOT a complete idiot. You’re obviously working with something new and doing your best to figure things out which is an admirable trait.

First thing you need to do is determine exactly how you want the process to occur which can be multiple ways, you just need to plan each one out.

Scenario 1 - Add a radio button question in the first part of your form. Are you a returning customer?

  • If they select Yes then you prompt them to log in and hide step 2 of your form.
  • If they select no keep step 2 of your form. In step 2 you have them fill out their details and using the User Registration Add-on create an account for them. When they go to check out WooCommerce will prepopulate the name and address information from the newly created account.

With either of these options Gravity Forms then has the information to generate your vendor order form PDF.

Scenario 2 - Exclude step 2 of your form entirely. Change when/where your vendor order form PDF is created. Instead of being created from data in your Gravity Form, when the Gravity Form is submitted, have it created when the WooCommerce Order is completed using information from WooCommerce.

1 Like

Wow! thank you, I really like both scenario’s but lets say I go with #2 my question is I guess mechanical when/where/how do I create this form that Woo Order will fill out? Can it be just a hidden form overall and have it fill and fire the email when the order completes or do I have to attach the form to a page? This form and final PDF is strictly internal it goes to my vendor public (customers will never see it) I guess basically I am creating a very specific pick/packing list that when finished I print it and stick in a box and mail it.

I sometimes have issues explaining things in written form, too long and wordy, so I find Video Explanations to be much more helpful (Google Drive link). NOTE: Download the video vs watching it in your browser. That way when you view it full size it’s clear.

Going back to your staging site, I have to ask. Why the Gravity Form? Can’t you accomplish the same thing with something like this: Snell / McCaffery Neck Mic – WooCommerce Reporting

1 Like

Holy crap!!! thanks for doing the video its awesome!! OK so I follow everything pretty well my question is when I auto-pdf or upload a pdf as I have done will I be able to see the gravity form fields in the woocommerce order keys?? Or does it just dump the contents of the cart product by product? On woocommerce reporting not sure I follow I only see the product page in your link.