Gravity Wiz

Magically enhanced tutorials, snippets and plugins for Gravity Forms!

  • Gravity Perks
    • Gravity Perks
    • Tutorials & Snippets
    • About
  • Support
    • Documentation
    • Support
    • Account

Gravity Forms QR Code

Bridge the physical and digital world with QR codes for managing events, discounts, inventory, and more.

This plugin is part of Gravity Perks, a suite of 41+ essential Gravity Forms addons with support you can count on.

  • View All Perks
  • Buy Gravity Perks

What does it do?

Gravity Forms QR Code allows you to generate QR codes from Gravity Forms field values, or scan QR codes to insert values into Gravity Forms fields.

Captured field values can be output as QR codes in form confirmations, notifications, and anywhere else merge tags are supported. QR codes can be scanned into Single Line Text and Paragraph fields directly on forms.

Here’s how you can use QR codes to enhance forms and business workflows:

  • Sell tickets to an event and check in attendees.
  • Integrate with flows where existing QR codes are created, such as government agencies or trade shows, and easily facilitate the transfer of data between online and offline spaces.
  • Generate scannable coupon codes and scan them into your order form.

Features

  • Create QR codes from any form data.
    Generate QR codes from any field value that field’s merge tag, or combine data with the [gpqr] shortcode.
  • Scan QR codes in your forms.
    Scan QR codes to insert data directly into your fields using your device’s camera.
  • Fully customizable.
    Tailor the size, content, and colors of your QR codes with ease.
  • Works with other Gravity Forms plugins automatically.
    Display QR codes in Gravity PDF, GravityView, Preview Submission or anywhere else that merge tags (or shortcodes) can be displayed.
  • Extensible scanning support.
    Enable scanning additional barcode formats to integrate with existing systems like UPC, EAN, and more!
  • Drag-and-drop support.
    Desktop computers can drag-and-drop image files containing QR codes.
  • Automatic updates.
    Get updates and the latest features right in your dashboard.
  • Legendary support.
    We’re here to help! And we mean it.

Documentation

  1. How do I enable this functionality?
    1. Generate QR Codes
    2. Scan QR Codes
  2. Feature Details
    1. QR Code Merge Tags
      1. Modifiers for the QR Code Merge Tag
      2. Generate QR Code From a Choice Field’s Value
    2. [gpqr] Shortcode
    3. Scan QR Codes In Forms
      1. Supporting Additional Formats
  3. Integrations
    1. Preview Submission
    2. Unique ID
    3. Populate Anything
  4. Use Cases
    1. Use-case: Event Registration
    2. Use-case: Integrating Into Existing QR Flows
    3. Use-case: Generate Scannable Coupon Codes
    4. Use-case: Product Inventory
  5. FAQs
    1. Where is the QR field/feed?
    2. How can I use the QR code scanner on other fields?
    3. Why does my browser request camera permission every time I use the in-field QR scanner?
  6. Hooks

How do I enable this functionality?

After installing and activating Gravity Forms QR Code, QR codes can be generated via merge tags and scanned with a Single Line Text field.

The following instructions will show you how to generate a QR code and scan that QR code using a Single Line Text field.

Generate QR Codes

Navigate to a form’s notification settings.
Edit an existing notification or create a new one.
Insert the merge tag for a field and add the :qr merge tag modifier.

Scan QR Codes

Add a Single Line Text field to your form.
Open the field’s settings, navigate to the Perks section, and check Enable QR Code Scanner.
Preview the form to see the code scanner button is auto-appended to your field.

Feature Details

QR Code Merge Tags

Gravity Forms QR Code can turn any field’s value into a QR code with the :qr merge tag modifier. Simply add it to any merge tag in any place field merge tags are supported, such as Confirmations and Notifications. When the merge tag is rendered, instead of showing the field’s value it will show a QR code of that value.

The :qr merge tag works with most merge tags that are available on Notifications and Confirmation pages. Generate QR codes for entry IDs, post/page IDs, or combine them with field values using the [gpqr] shortcode!

Modifiers for the QR Code Merge Tag
  • :size – Specify the size (height and width) in pixels of the QR code.

    This would generate a 200px QR code.

    {My Field:1:qr,size[200]}

  • :bg_color – Specify a hex color for the QR code background.

    This would generate a QR code with a red background.

    {My Field:1:qr,bg_color[#f00]}

  • :fg_color – Specify a hex color for the QR code foreground.

    This would generate a QR code with a blue foreground.

    {My Field:1:qr,bg_color[#00f]}

When using multiple merge tag modifiers on a field, separate the modifiers with a comma.
Generate QR Code From a Choice Field’s Value

By default, merge tags in Gravity Forms will render any choice-based fields, such as Drop Down or Radio Button, as the field’s label. If you have activated the show values option on the choice field and set a different value, you might want to display a QR code from that value instead of the label. To do this, add the :value merge tag modifier to your merge tag.

{Drop Down:2:qr,value}

[gpqr] Shortcode

Use the [gpqr] shortcode to combine multiple fields or any other data you need in your QR code. For example, to add a static prefix to your QR code, you can combine a string with the field’s merge tag.

[gpqr]Ticket Number: {Ticket ID:3}[/gpqr]

The shortcode accepts two parameters, format and size.

  • format string

    When set to url, will return a link to the QR image file. Defaults to html, which returns the image markup for the QR code.

  • size integer

    The size, in pixels, of the QR code image file. Defaults to 200.

The following example will output a 500 pixel QR code that contains 2 field values and some static text.

[gpqr size="500"]Ticket Info: {Ticket ID:3} {Price:4.3}[/gpqr]

The following will output a URL to the hosted QR code image that is 300 pixels.

[gpqr size="300" format="url"]{Ticket ID:3}[/gpqr]

This is the URL generated from the above shortcode:

http://yoursite.local/wp-content/uploads/gravity_forms/gpqr-codes/25b22f6b66f94db6d1e889b9a85c7fe4.png

Scan QR Codes In Forms

Gravity Forms QR Code supports scanning QR codes directly into fields on your forms. To activate this feature, navigate to the Perks tab in any Single Line Text or Paragraph field on your form, then check Enable QR Code Scanner.

Once activated, GF QR Code will add a QR code icon to the end of the field. When clicked, the user can use their device’s camera to scan the QR code.

When using a desktop computer, the QR code field will accept drag-and-drop file uploads.
Supporting Additional Formats

GF QR Code supports scanning in additional formats outside of QR code, with the use of the gpqr_scanner_config hook. By default, only QR code scanning is supported, but the library that powers GF QR Code supports scanning UPC, EAN, and many additional formats.

Integrations

GF QR Code integrates seamlessly with our Perks and other Gravity Forms add-ons.

Preview Submission

QR code merge tags can be displayed in a submission preview in multi-page forms using Preview Submission. Insert the QR code merge tag into an HTML field on the last page of your form, and it will be displayed when the user navigates to the page.

Unique ID

Unique ID field values can be used to generate QR codes. The :qr merge tag modifier fully supports Unique ID fields.

Populate Anything

Using Populate Anything’s Live Merge Tags, QR codes can be generated live on the page when a user enters values into a field.

Use Cases

Use-case: Event Registration

Selling tickets and checking in attendees is made easy by combining QR Code with Easy Passthrough. One form sends a QR code to customers after purchasing tickets, and another form scans those QR codes at the event entrance.

Start by setting up your ticket purchase form however you’d like. Our form captures Name, Email, and Ticket Type.

On that form’s notification, use the [gpqr] shortcode to generate a QR code for a link to the event check-in form. Include the Easy Passthrough Token in the URL to enable purchase lookup.

[gpqr]https://mysite.com/check-in/?ep_token={Easy Passthrough Token}[/gpqr]

For the check-in form, add the fields you want to load from the customer’s purchase. Then, set up an Easy Passthrough feed to pass through the values from the purchase form.

At the event entrance, staff can scan the QR code using any QR scanning app on their phone. Once the code is scanned, a browser will open the check-in form and pre-load the user’s information. Attendees could even self check-in at a kiosk.

Use-case: Integrating Into Existing QR Flows

Many sites generate QR codes to ease data transfer between the online and offline spaces. For example, many government sites use QR codes to denote vaccination status. With GF QR Code, you can easily retrieve the data in the QR code and store it in a field on your form.

Start by adding a Single Line Text or Paragraph field to your form. Both support reading QR codes. Then, navigate to the Perks tab and check Enable QR Code Scanner.

Once activated, GF QR Code automatically adds a scan button to the field, making it easy to scan codes.

Use-case: Generate Scannable Coupon Codes

Pairing GF QR Code, the Gravity Forms Coupons add-on, and GF Unique ID, you can easily create scannable coupon codes for use with your purchase forms.

Begin by adding a Unique ID field to your form. Note the field ID, as you will be using it in the configuration of our coupon generation snippet.

Configure the snippet for the type of coupon, amount, and set the source_field_id to match your Unique ID field’s ID.

new GW_Create_Coupon( array(
	'form_id'         => 608,
	'source_field_id' => 1,
	'plugin'          => 'gf',
	'amount'          => 15,
	'type'            => 'flat'
) );

In your form’s notification, insert the merge tag for your Unique ID field and add the :qr merge tag modifier to output a QR code of the unique ID.

On your purchase form, add a Coupon field and check Enable QR Code Scanner in the Perks tab.

Customers can then scan the QR code to apply the discount to their purchase.

Use-case: Product Inventory

Take WooCommerce product creation one step further by adding scannable QR codes to track product SKUs. By pairing GF QR Code with GF Unique ID, you can easily generate product SKUs when creating a WooCommerce product, and then output a QR code for that product SKU in your form confirmation, notification, or a printable PDF.

Simply add a Unique ID field to your product creation form and map it to the _sku Custom Field as shown in our How to Create WooCommerce Products with Gravity Forms article.

You can then create a product restock request form that uses Populate Anything to populate product details. When inventory is low, the product’s QR code is scanned, the rest of the product info is automatically populated, and the only thing that needs to be manually entered is the desired quantity.

Already have UPC codes on your products? GF QR Code can read those, too!

FAQs

Where is the QR field/feed?

Instead of introducing new fields to handle QR codes, we opted to integrate them with existing Gravity Forms functions. QR code generation is done with the :qr merge tag modifier. QR codes are scanned in either Single Line Text or Paragraph fields. Simply enable the QR code scanner in the Perks tab.

How can I use the QR code scanner on other fields?

To add the QR code scanner to a field that isn’t currently supported, use the gpqr_is_supported_field hook.

Why does my browser request camera permission every time I use the in-field QR scanner?

Camera permissions vary significantly between your devices and applications. We will do our best to document each combination as it is reported here.

iPhone Safari

It is possible to grant a specific website permission to use your iPhone camera permanently. We recommend only granting this permission if you own the website. If you are certain that website can be trusted, follow these instructions.

Hooks

  • gpqr_is_supported_field (JS)
  • gpqr_on_scan_success (JS)
  • gpqr_scanner_config (JS)
Gravity Forms has hundreds of hooks. Check out our Gravity Forms Hook Reference for the most thorough guide to Gravity Forms’ many actions and filters.

Perk Deets

  • Version 1.0-beta-2.0
  • Updated August 9, 2022
  • Released July 11, 2022
  • View Changelog

Changelog

1.0-beta-2.0

  • Added support for a new type modifier than can be used to generate other types of codes such as UPCA or PDF417. Example: {Label:1:qr,type[PDF417]}.

1.0-beta-1.3

  • Added support for using the url modifier with the qr modifier in merge tags.

1.0-beta-1.2

  • Added new gpqr_on_scan_success JavaScript action.

1.0-beta-1.1

  • Fixed issue where QR codes failing to generate could cause a fatal error.

1.0-beta-1

  • Added support for optionally passing hex colors to fg_color and bg_color merge tag modifiers/shortcode attributes to control the foreground and background colors of the QR code.
  • Added [gpqr] shortcode.
  • Added support for more generic merge tags such as {entry_url:qr} and {user:display_name,qr}
  • Added new gpqr_is_supported_field JavaScript filter and added support for coupon fields.
  • Added gpqr_scanner_config JavaScript filter.
  • Added i18n
  • Improved basic styling of QR Code scanner.
  • Added "Update URI" to plugin header to improve security.

1.0-alpha-1

  • Hello World!

All Perks

  • GF Address Autocomplete
  • GF Advanced Calculations
  • GF Auto List Field
  • GF Auto Login
  • GF Better User Activation
  • GF Blocklist
  • GF Conditional Logic Dates
  • GF Conditional Pricing
  • GF Copy Cat
  • GF Date Time Calculator
  • GF Disable Entry Creation
  • GF Easy Passthrough
  • GF eCommerce Fields
  • GF Email Users
  • GF Entry Blocks
  • GF Expand Textareas
  • GF File Upload Pro
  • GF Inventory
  • GF Limit Checkboxes
  • GF Limit Choices
  • GF Limit Dates
  • GF Limit Submissions
  • GF Live Preview
  • GF Media Library
  • GF Multi-Page Navigation
  • GF Nested Forms
  • GF Notification Scheduler
  • GF Page Transitions
  • GF Pay Per Word
  • GF PayPal One-time Fee
  • GF Placeholder
  • GF Populate Anything
  • GF Post Content Merge Tags
  • GF Preview Submission
  • GF Price Range
  • GF QR Code
  • GF Randomizer
  • GF Read Only
  • GF Reload Form
  • GF Terms Of Service
  • GF Unique ID
  • GF Word Count

Copyright © 2022 · Powered by WordPress · Gravity Wiz LLC

  • Support
  • Affiliates
  • About
  • Sitemap
  • Terms & Conditions of Use
  • Privacy Policy
  • Cookies Policy

Get access to hundreds of Gravity Forms plugins for free!

Enter your email and receive a list of our most popular free snippets and plugins for Gravity Forms.

  • Gravity Perks
    ▼
    • Gravity Perks
    • Tutorials & Snippets
    • About
  • Support
    ▼
    • Documentation
    • Support
    • Account