Is there a way to pre-fill an order form?

We are selling some additional subscriptions to our current customers, and we have our own custom website (aka portal).

Is there anyway for (logged in customers), if they click the link to the order form, that we can pre-fill the info we have in our portal so the customer doesn’t need to type it in ?

I have looked at the page source and tried to deduce field field names and experimented with query strings and stuff, but I didn’t make any headway.

Just curious, does anyone out there knows a method to pre-populate order forms ?


It looks like, if you want to provide them, you can supply them via the following URIEncoded querystring parameters:


And to populate the Shipping information:



Thanks @TomScott,

This is a great help.

By chance do you know if we can also Pre-Fill the Promo Code field ?


I don’t believe there is an easy way to do it, as they are applied immediately to an order with items.

The fields are set by the value property and do not respond to url parameters. This would be possible with javascript which can get the parameters and assign the values dynamically (including promo code) but that’s the only way I got it to work in testing.

@TomScott @John_Borelli and anyone else out there …

So same question for Shopping Cart ?

Trying to use mimic of JS for OrderForms in the Shopping Cart requests…

The request for that page.


Do we have any control over how the app/manageCart/addProduct page redirects to the app/manageCart/showManageOrder page?

Recap: We built a custom “Campaign Landing Page” for marketing purposes and have several flows, Landing Page → InfSoft Campaign
Landing Page → InfSoft Order Form
Landing Page → Straight to “Reward” content on our live site

and the flow we’re working on now is Landing Page → Shopping Cart, and our landing pages have the PromoCode so that we can ‘vet’ some entries and in some cases we pass through to InfusionSoft OrderForm , etc …

But we’re stuck on the Shopping Cart Flow …

Any Thoughts ?


So if anyone wants to use our JavaScript feel free… however no Warranty provided…so you’ll need to test / support it in yourselves.

Disclaimer aside, we’re able to drop this into the HTML Header area on the OrderForm Theme customization and get the Query String processing discussed in this thread (i.e. pre-fill the PromoCode based on URL Encoded parameters.

function getParameterByName(name, url) {
    if (!url) url = window.location.href;
    name = name.replace(/[\[\]]/g, "\\$&");
    var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
        results = regex.exec(url);
    if (!results) return null;
    if (!results[2]) return '';
    return decodeURIComponent(results[2].replace(/\+/g, " "));

<script type="text/javascript">  
    jQuery(document).ready(function () {
    var promo_code = getParameterByName('inf_field_PromoCode');
    if (promo_code && promo_code.length > 0) {
    var url = window.location.href;
    var regex = new RegExp("\/app\/orderForms\/([^\/\?]+)");
    var results = regex.exec(url);
    if (results && results[1]) {
      var order_form_id = results[1];
      Infusion.Ecomm.OrderForms.ajaxSubmitForm('orderForm', false, 0, 0, order_form_id, 'RENDER_ORDER_FORM', ['ORDER_FORM_PRODUCT_LIST', 'ORDER_FORM_SUMMARY', 'UP_SELLS', 'PAYMENT_PLANS', 'SHIPPING_OPTIONS']);

A few notes:

  • The PromoCode in the URL must be inf_field_PromoCode

  • It extracts the Form Name from the “vanity” url provided in the “Links” section of the OrderForm configuration… so the “Nice Readable URL” …

  • This also assumes the OrderForm Theme …is pretty standard across all the InfusionSoft options… It’s possible one of the themes does not use the same form field identifiers and stuff, so the jQuery might break down…but assuming all the InfusionSotf themes are pretty standard, this should work.

Otherwise this is pretty generic JavaScript …

1 Like


I can’t seem to get that to work with Shopping Cart, as the page we need the script to run on, is showManageOrder page which does not have any configuration options …

We have the JS on addProduct page, inserting JS on the custom HTML blocks, but it is lost on the manageCart

How did you bridge that transition ?

Or specifically, how did you get javascript on the /manageCart/showManageOrder page ?


So then you’re not just wanting to simply populate some fields. You want to actually add items to a checkout page and go directly to that without the rest of the shopping cart experience. I would normally suggest just using the order forms for that but I’ll assume you plan on things being more dynamic. I’m still not sure why you don’t want them taking the first step but sure you have your reasons.

If this is accurate, then I think your questions have you jumping a head in line. The question about wanting to pre-fill the info that we started with may not be the best thing to do (or it may be).

So high level now, no worrying about how yet. You have a site that you want people to purchase subscriptions on. Are you trying to replace the order process from your site or are you just concerned about getting that reflected within Infusionsoft in an actionable way?


The Subscription / OrderForm is working well and no issues with that.

The use-case we are looking at right is of the ilk: “Sign-Up for our Newsletter and get $10 off the new water bottle”

On form submission, want to redirect to check-out, with item already in cart.

The e-Commerce action in all of the shopping cart scenario’s would be non-subscriptions (so one-time purchases.) … and am looking to be able to link a product to our landing page / Custom WebForms …and pre-fill User Name, Email info (which works), but would also like to put the PromoCode on the front most form, or hide it all-together (to spoof the lack of single-use codes & Gift Certificates in InfusionSoft)

Obviously, InfusionSoft needs the PromoCode in order to apply the discount, etc.

So the goal is to get a similar flow to that of the OrderForms working for the Shopping Cart.

So by logged in customer, you must be referring to logged in on your website…that’s dis-connect one. The second point for clarity is that it’s a much different thing to want to pre-populate a form than it is to submit products to a shopping cart checkout (especially where IS shopping carts are concerned). Personally, I don’t know of a way to do that. It’s conceivable that passing the email address from your website to your shopping cart checkout would work to get the contact context for the checkout page but I can’t say about the latter part.


So there are two threads going on here… that ‘logged in’ comment, was in the context of the OrderForm (not the context of this ShoppingCart Question). All my OrderForm issues have been sorted out.

The issue I am probing now, is how to use a (custom) WebForm in a marketing campaign to draw sign-ups by offering discounts to one-time products.

“Sign-Up for the Newsletter and get $10 off a water bottle”

We want to optimize the check-out UX, so am looking to jump straight to CheckOut and pre-fill as much as possible.

I left this discussion about the ShoppingCart flow on this thread, because I thought it might overlap with “JavaScript for eCommerce Tweaks” as a broader topic… We’ve already discussed custom JavaScript on an OrderForm, and if there is a similar solution, it seems relevant to also have the JavaScript for ShoppingCart, in close proximity for future reference, so JS customization on eCommerce pre-fill is in one place.

However, it seems, there is no similar solution for ShoppingCart. Which is what I was guessing, since the shopping cart theme editor gives very limited HTML access to customize the checkout.

Thanks for your insights on this.


Ok, so in the context of the “Signup for newsletter…” objective: Why couldn’t you just use a landing page with the optin and then lead to a thank you page that reveals a product specific promo code for them to use?

We can. I never said I didn’t have any solution to this use-case. I was trying to use the same pattern we established for OrderForms (hence the whole pre-fill commonality)

Every promotion is different. As I said earlier, in some cases, we want this to be an exclusive offer to the list that we are targeting. In a dream scenario, each individual would get a personal code, but since InfusionSoft does not support individualized PromoCodes, this is overly burdensome. One way to simulate this single-use PromoCode feature, would be keep the actual PromoCode value private, by having the (custom) Landing Page, pass along the PromoCode and pre-fill it for the customer. It is not totally secure, but it slightly obscures the code and prevents unwanted sharing.

Even in your situation with the custom Thank-You, I’d ask the same question, how can we streamline the checkout UX? If there is a link for “add to cart” on the custom thank you page for the product, I’d still want to pre-fill with as much data as possible, since I’ve already collected, name, email address (and I know the promo code.) In order to streamline the check-out I’d be looking to pre-fill off the action on the Thank-You page, so the Customer does not need to enter data multiple times.

The heart of the question, is what is the fewest numbers of actions we require of our users to get the desired outcome? I know of multiple work arounds, and its not that I don’t know another way to solve this, I"m looking for an optimal way to solve this that integrates with out (custom) forms. Ideally with as similar a pattern as possible.

I am looking for a way that is fewer steps then delivering promo code on a thank-you page or an email…(and we have such a solution with JavaScript discussion related to OrderForms)

Hi Tom,
I was trying to use your code, maybe I explain my problem, I have a new landing page online web form, then I pass it to shopping cart, so when Sales fill out the form and click on next, I send it to shopping cart , but the billing info is not yet populated so make it hard to use, asking client again for the billing info.
I was trying to use this to test but didn’t work
I would like to use your code, any suggestion,
Thanks for your help1

is there any way to do without any coding, or any YouTube video who can help

No, not without accessing the API or hacking together something that interacts with the UI in a brittle manner.

And by “brittle manner” what @TomScott really means is “likely mess everything up” lol

Is it still valid in 2023?

Not working for me.


I haven’t tested it lately since it’s not really under our team’s umbrella of API concerns. I’ll move this thread over to the Keap Classic forum so you can see if you can get more current input.