Skip to main content
Cookbook Marketing Ninja Forms

Build a Price Quote Calculator with Ninja Forms and AI

Give it your price list; the AI builds a form that shows the price live as visitors pick options and emails you each request with its estimate.

Difficulty Intermediate
Time ~15 min

Prerequisites

A site connected to WPVibe running Ninja Forms 3.15.6 or newer (tested on the free 3.15.6) on WordPress 6.9 or newer, with an administrator account.

The prompt
My site runs Ninja Forms. Build a quote form called [form name] for [what you price, for example airport transfers] that shows the price live as people fill it in. Prices: [your price list with its currency, for example Cancun hotel zone 60 dollars, Playa del Carmen 90, Tulum 120; a return trip doubles it; plus 10 dollars per passenger]. Also ask for [contact details, for example name and email]. Email each request to [my email address], and give me a share link to try it.

From my request take FORM_NAME, MY_EMAIL and CURRENCY_SYMBOL (the symbol for the currency of my prices, for example $).

1. Run run_wp_cli with plugin get ninja-forms; if its version is below 3.15.6, tell me to update Ninja Forms and stop. Then run get_ability_info for each Ninja Forms ability this uses: ninjaforms/list-forms, ninjaforms/create-form, ninjaforms/get-form, ninjaforms/list-calculations, ninjaforms/update-field, ninjaforms/update-calculation, ninjaforms/get-public-link, ninjaforms/embed-form. If one is not found, tell me and stop.
2. Run ninjaforms/list-forms. If a form called FORM_NAME exists, stop and ask.
3. Turn my price list into a form and a formula: each priced choice becomes a listselect (dropdown) field whose options carry a calc value (the price, or a multiplier such as 1 and 2); use dropdowns, not radio buttons, because a dropdown always has an option picked, so the estimate is right from the start. Each quantity becomes a number field with default_value 1. One calculation named quote adds and multiplies them with {field:KEY} for each field and only + - * / and brackets. Show me the formula in plain words and work out two examples from my price list by hand. Wait for my yes.
4. Choose every field key first (a short name, an underscore and 13 digits). Run ninjaforms/create-form once with title FORM_NAME and: the priced and quantity fields (required, options with label, value and calc); then an html field whose content goes in default (not default_value, which strips the heading) and is an h3 heading reading Estimated price: CURRENCY_SYMBOL {calc:quote} (a space before and after the merge tag, nothing else in that field); then a hidden field labelled Estimated price with key ESTIMATE_KEY and default_value {calc:quote}, which saves the estimate with each request; then the contact fields (personally_identifiable true on email and phone); calculations with one item: name quote, eq the formula, dec 2; and actions with two items: an email (label Email to me, settings to MY_EMAIL, email_subject naming the form, email_format html, email_message Estimated price: CURRENCY_SYMBOL {field:ESTIMATE_KEY} in a paragraph followed by {fields_table}) and a successmessage (settings success_msg saying we will confirm by email). Ninja Forms adds saving of submissions itself. Use {field:ESTIMATE_KEY} in emails, never {calc:quote}: Ninja Forms leaves calc tags unfilled in emails, and its table of answers leaves out hidden fields.
5. Run ninjaforms/get-form and ninjaforms/list-calculations. Check every {field:KEY} in the formula matches a field key exactly and every priced option has its calc value; fix a formula with ninjaforms/update-calculation (form_id, name quote, formula; it does not read eq) and a field with ninjaforms/update-field (for a list field, send its full options list from get-form with the change: options replace the whole list), then recheck; to fix the price heading, use ninjaforms/update-field with default_value (update-field does not take default). The email's message can't be read back through these abilities; the test email in step 6 checks it.
6. Run ninjaforms/get-public-link with form_id and enable true. Give me the link and the two worked examples to try; the estimate on screen should match them, and the email to me should show it. Tell me anyone with the link can use the form while it is on, and that the estimate in a request comes from the visitor's browser, so it is a guide, not a price they can hold me to.
7. When I am happy, ask whether to switch the link off (ninjaforms/get-public-link with enable false) and whether to place the form on a new draft page, and ask me for its title (PAGE_TITLE). Draft page: run ninjaforms/embed-form with form_id and post_title PAGE_TITLE only. If it finds a page (page_found), call the post_id it returns POST_ID and stop: run run_wp_cli with post get POST_ID and tell me that page's title and status, and ask whether to add the form there (on a published page the form goes live at once) or pick another title. On my yes for that page, run ninjaforms/embed-form with form_id, post_id POST_ID, embed_method block and placement at_end. If no page is found, ask me to confirm a new page, then run ninjaforms/embed-form with form_id, post_title PAGE_TITLE, confirm_create true, embed_method block, placement at_end and post_status draft. Never send post_status publish. Give me the page link to preview; I publish it myself.
Already connected?

Skip pasting the full prompt. Drop this into your AI on a site that already has WPVibe:

Run the “Build a Price Quote Calculator with Ninja Forms and AI” recipe from the WPVibe cookbook on my connected site.

People want to know what it costs before they get in touch. Without a price on the page they leave, or they send a form and wait a day for a number you could have shown them. Ninja Forms can work the price out live as they pick options, but setting up the calculation by hand is fiddly.

Give the AI your price list and it builds the quote form: a dropdown for each priced option, a number for each quantity, the formula, and the estimate on screen that updates as visitors fill it in. It checks the formula against two worked examples with you before anything is built, saves the estimate with each request, puts it at the top of the email to you, and gives you a link to try it.

Write the prices the way you would explain them to a customer: a price per option, what doubles or adds, a cost per person. The estimate is worked out in the visitor’s browser, so treat the figure in a request as a guide and confirm the price yourself. Try the worked examples on the link before you place the form on a page.

Outcome

A Ninja Forms quote form that shows an estimated price as it is filled in and emails you each request with that estimate.