How to Separate Product Selection and Price When Exporting Entries

How to Separate Product Selection and Price When Exporting Entries

By default, export columns which separate the product name and the product price are available for single product fields. However, these export columns are not available for product fields that present choices (i.e. with a field type of dropdown or radio buttons).

The following code block, when added to your site, will append options on your Export Entries screen for Product (Name), Product (Value), and Product (Price). These new columns will be available for all choice Product fields – including the Option and Shipping fields. It will also enable similar export columns (to show name and value) for Radio fields.

If you want to customize the heading labels in the export, this will also respect any Admin Labels you have set for the fields.

//Add export columns for label, value, and price of single choice fields
add_filter( 'gform_export_fields', function( $form ) {

foreach ( $form['fields'] as $key => $field ) {

$is_product_like_field = ( $field->type == 'product' || $field->type == 'option' || $field->type == 'shipping' ) ? true : false;

if ( ( $is_product_like_field || $field->type == 'radio' ) && is_array( $field->choices ) ) {

// unset( $form['fields'][ $key ] ); // uncomment to remove the original field from the export list

// append our additional columns
array_push( $form['fields'], array( 'id' => $field->id.'_text', 'label' => $field->label.' (Name)' ) );
array_push( $form['fields'], array( 'id' => $field->id.'_value', 'label' => $field->label.' (Value)' ) );
if ( $is_product_like_field ) {
array_push( $form['fields'], array( 'id' => $field->id.'_price', 'label' => $field->label.' (Price)' ) );
}

// set the headers for each added column
add_filter( "gform_entries_field_header_pre_export_{$form['id']}_{$field->id}_text", function( $header, $form, $export_field ) {
return $header.' (Name)';
}, 10, 3 );
add_filter( "gform_entries_field_header_pre_export_{$form['id']}_{$field->id}_value", function( $header, $form, $export_field ) {
return $header.' (Value)';
}, 10, 3 );
if ( $is_product_like_field ) {
add_filter( "gform_entries_field_header_pre_export_{$form['id']}_{$field->id}_price", function( $header, $form, $export_field ) {
return $header.' (Price)';
}, 10, 3 );
}

// set the values for each added column
add_filter( 'gform_export_field_value', function( $value, $form_id, $field_id, $entry ) use ( $field ) {

$product_data = explode( '|', rgar( $entry, $field->id ) );
$product_choice = array_filter( $field->choices, function( $choice ) use ( $product_data ) {
return ( $choice['value'] == $product_data[0] );
} );
$product_choice = array_values( $product_choice );

switch ( $field_id ) {
case $field->id.'_text':
return $product_choice[0]['text'];
break;
case $field->id.'_value':
return $product_data[0];
break;
case $field->id.'_price':
return $product_data[1];
break;
default:
return $value;
break;
}

}, 10, 4 );

}

}

return $form;

} );

For additional information on the filters in use:

gform_export_fieldsgform_entries_field_header_pre_exportgform_export_field_value

「How To」 Blog Posts

「How To」 Blog Posts

List of Blog 「How To」 ArticlesList of Blog Starter Guides

Blog
The official Gravity Forms Blog is a fantastic resource for keeping up to date on new releases, promotions, product updates, partner releases, tips and tricks and more! Below we have collected a small sample of the How To articles posted there.
The best way to keep up to date? Sign up for the Gravity Forms newsletter and be notified when new articles get posted!
List of Blog 「How To」 Articles
How to… Take Subscriptions on your WordPress Website with Stripe
How to… Accept File Submissions Through a Form
How to… Add Images to a Form
How to… Collect and Store Consent with the Gravity Forms Consent Field
How to… Create a Multi-Page Form
How to… Customize the Text on a Form』s Submit Button
How to… Redirect Users to a New Page or URL After Form Submission
How to… Send Form Entries to Google Sheets Using Zapier
How to… Capture Signatures Online (with the Gravity Forms Signature Add-On)
How to… Configure a Custom Confirmation Message
How to… Add a Poll to Your WordPress Website
How to… Configure Custom Notifications
How to… Take Payments on Your WordPress Website with Gravity Forms and Mollie
How to Take Payments with Apple Pay and Google Pay in WordPress
How to… Embed Forms using Code
How to… Import and Export Forms with Gravity Forms
How to… Export Form Entries
How to… Prevent Spam Form Entries
How to… Capture Partial Form Entries
How to… Create a Quiz for Your WordPress Website
How to… Use Conditional Logic to Create Smarter Forms
How to… Create WordPress Forms with Save and Continue
How to… Add Google reCAPTCHA v2 and v3 to Your Forms
How to… Filter Spam Form Entries with Akismet
How to… Embed a Form in WordPress
How to… Create a Mailchimp Signup Form
How to… Send Form File Uploads to Dropbox
How to… Create a Form in WordPress
How to… Reliably Deliver WordPress Form Notifications with a Transactional Email ServiceNew!
How to… Create a HubSpot Contact FormNew!
List of Blog Starter Guides
Starter Guide: Just Bought a Gravity Forms License? Let』s get you set up…
Starter Guide: How to Import and Customize a Basic Contact Form
Starter Guide: How to Create a Survey with Gravity Forms
Starter Guide: How to Set Up User Registration on Your WordPress Website
Starter Guide: How to Create a Donation Form with Gravity Forms
Starter Guide: How to Create a Request a Quote Form
Starter Guide: How to Create a Webinar Registration Form
Starter Guide: How to Sell Gift Certificates on your WordPress Website
Starter Guide: How to Add an Appointment Booking Form to Your WordPress Website
Starter Guide: How to Create an Event Registration Form with Gravity Forms
Starter Guide: How to Create a Job Application Form in WordPress
Starter Guide: How to Create a Newsletter Signup Form (and collect leads!)
Starter Guide: How to Sell Products on your WordPress Website
Starter Guide: How to Create a Membership Site with Gravity Forms
Starter Guide: How to Create a Subscription Form for Your BusinessNew!
Starter Guide: How to Create a Course Registration FormNew!

Setting Up the HipChat Add-On

Setting Up the HipChat Add-On

Pre-RequisitesSetup

The HipChat service was discontinued in 2019 after acquisition by Atlassian.The Gravity Forms add-on is no longer available for download. These documents have been left for posterity only, and will be removed in time.
Pre-Requisites

Download and install the add-on
A HipChat account

Setup

Log into your WordPress admin dashboard.
On the left side navigation menu, hover over Forms and click on Settings.
From this page, click the HipChat tab.
Enter your Authentication Token. Your HipChat API Authentication Token can be generated via the Group Admin area of your HipChat account. Click on the Group Admin link in the HipChat toolbar, select API from the Group Admin navigation, and generate an authentication token. You must configure the authentication token as an admin token and not a notification token.
Click Update Settings. If you』ve entered your account information correctly, you will be notified by a green check mark beside the box. If you do not see a green check mark, please double check this information and try again.

Once you have entered your authentication token, you』re ready to begin creating a feed for the HipChat Add-On.

HTML Field CSS Selectors

HTML Field CSS Selectors

example: HTML field (li) – applies to all forms
1body .gform_wrapper .gform_body .gform_fields .gfield_html {border: 1px solid red}
example: HTML field (li) – applies just to form ID #1
1body #gform_wrapper_1 .gform_body .gform_fields .gfield_html {border: 1px solid red}
example: HTML field (li) – applies just to specific HTML field (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
1body .gform_wrapper .gform_body .gform_fields #field_XX_X.gfield_html {border: 1px solid red}

Hidden Field

Hidden Field

IntroductionExampleUses

Introduction
The hidden type field, part of the Settings API, renders a hidden input.
Example
The HTML is created for the hidden field and you will see it if you view the page』s HTML source.
array(
'title' => esc_html__( 'This is the title for Section 4', 'sometextdomain' ),
'fields' => array(
array(
'type' => 'hidden',
'name' => 'myhiddenfield',
'label' => esc_html__( 'This is my hidden field', 'sometextdomain' ),
'default_value' => 'textformyhiddenfield',
),
),
),

The HTML code generated for the hidden field will look similar to the following:

Uses

settings_hidden()

How to Chain Forms Using Shortcodes

How to Chain Forms Using Shortcodes

This article explains how you can chain two forms together by placing the shortcode for another form inside the confirmation of the first form.

This results in the second form displaying upon submission of the first form. Data from the first form may be carried over to the second using parameters.

Below are the steps to follow:

Create the first form.Edit the Confirmation

Set the Confirmation Type to Text and enter the shortcode for the second form as the Message. [gravityform id="82" title="false" description="false" ajax="true" field_values="param_email={:2}"] It is very important that the ajax attribute is included and set to true for the shortcode to the second form. If not, upon submission of the second form, the first form will load again.If any data is meant to carry over and populate fields on the second form, add the field_values attribute to the shortcode. The parameter names used will be created on the second form so make sure the same names are used. The values listed will also depend on the field ids on the second form. This step could be done after the second form is created if the field ids or parameter names are unknown. For more information about the field_values attribute or how to pass data, see the following documents: Form ShortcodeUsing Dynamic PopulationUsing Confirmation Query Strings To Populate A Form Based On Another Submission. Create a page for the first form.Add the shortcode for the form to the page. The most important part here is that the ajax attribute is set to false, or not included because it defaults to false. If ajax is set to true, then submitting the second form will cause the first form to be loaded again. [gravityform id="7" title="true" description="true" ajax="false"] Create the second form. If there is any data that should carry over from the first form to be displayed in fields on the second form, set the fields on the second form to Allow field to be populated dynamically and enter a Parameter name.

After following the steps above, load the page of the first form and submit. The second form displays with any chosen data populated. Submit the second form and its confirmation page displays.

Bonus: When the second form is submitted, the header from the first form still displays. This can be removed by doing the following:

Add an HTML field to the second form.Add the following code to the Content. This jQuery code simply finds the HTML 「h1」 tag and replaces the text with nothing. The page header is inside the 「h1」 tag so it is removed. The script can be modified to target a specific element in the page as needed.

<script type="text/javascript">
var $ = jQuery.noConflict();
$("h1").text('');
</script>

HipChat Change Log

HipChat Change Log

1.2 | 2018-03-281.1 | 2016-08-311.0 | 2015-03-04

The HipChat service was discontinued in 2019 after acquisition by Atlassian.The Gravity Forms add-on is no longer available for download. These documents have been left for posterity only, and will be removed in time.
1.2 | 2018-03-28

Added security enhancements.
Added GPL to plugin header.
Updated Plugin URI and Author URI to use https.
Fixed strings for translations.

1.1 | 2016-08-31

Added feed duplication support.
Added default feed name for new feeds.
Added support for delaying feed processing until payment by PayPal Standard is successfully completed.
Added gf_hipchat() for easily getting an HipChat instance.
Added Spanish (es_ES) translation.
Added filter gform_hipchat_verify_ssl to disable SSL certificate verification during API requests.
Updated HipChat API library to use WordPress API functions.
Updated feed processing so that empty messages are not posted to room.

1.0 | 2015-03-04

It's all new!

Hidden

Hidden

SummaryCommon SettingsMerge TagsUsageModifiers

Summary

The Hidden field can be used to store information that should not be visible to the user but can be processed and stored with the user submission. It is available under the Standard Fields section within the form editor.

Hidden field as displayed in the Field Library

Hidden field as displayed in the Form Editor.

Common Settings

This field uses only common field settings for the General, Appearance, and Advanced settings. For a description of each of the common field settings, refer to this article. Below you will find description of specialty settings that are particular to this field.

Merge Tags

For more information on the use of merge tags, refer to these articles.

Usage

{Field Name:2}

Modifiers

This merge tag does not have any modifiers.

How To Change Your Language In Gravity Forms

How To Change Your Language In Gravity Forms

Languages available in Gravity FormsChanging your WordPress installation language

By default Gravity Forms is available in US English. But with users in every continent, island, and corner of the globe, we have built Gravity Forms to support many different languages.
The language of Gravity Forms, all you need to do is change the language of your WordPress installation. In this article, we will show you how to change the language of your WordPress installation, which subsequently changes the language of Gravity Forms.
Languages available in Gravity Forms
A list of all translations included with Gravity Forms, as well as download links for their source files may be found on our Translations page.
Changing your WordPress installation language

First, log into your WordPress admin dashboard.
Once logged in, hover over Settings on the left side menu panel, and click on General.
From within this page, there is a dropdown labeled Site Language. Simply use this dropdown to select your desired language.
Now that your language is selected, simply click the Save Changes button.

The language used by your WordPress installation will now be changed to the language you have selected. This change will also change the language of Gravity Forms as well.
Gravity Forms also supports loading translations from a gravityforms folder in the WP_LANG_DIR directory e.g. /wp-content/languages/gravityforms/

HipChat Feed Meta

HipChat Feed Meta

IntroductionUsageProperties

Introduction
The Feed Object meta for the HipChat add-on is an associative array containing the properties which determine how the add-on should process the form submission.
12345678910$feed['meta'] = array(    'feed_name'                               => 'Your Feed Name',    'color'                                   => 'yellow',    'notify'                                  => false,    'message'                                 => 'Entry #{entry_id} has been added.',    'feed_condition_conditional_logic'        => true,    'feed_condition_conditional_logic_object' => array(        'conditionalLogic' => array(),    ),);
Usage
We recommend accessing the $feed meta using the rgar() or rgars() functions, e.g.:
1$conditional_logic_enabled = rgars( $feed, 'meta/feed_condition_conditional_logic' );

Properties

feed_name string
The feed name which appears on the add-ons feeds tab.

room string
The HipChat ID for the Room this feed will post a notification to.

color string
The color the notification will be displayed as. Possible values: yellow, green, red, purple, grey or random.

notify boolean
Should users in the room be notified (change the tab color, play a sound, etc) when the message is posted. Default is false.

message string
The message that will be posted to HipChat. Can contain merge tags.

feed_condition_conditional_logic boolean
Is the feed condition (conditional logic) setting enabled. Default is false.

feed_condition_conditional_logic_object array
An associative array containing the conditional logic rules. See the Conditional Logic Object for more details.