gform_display_product_summary

Description

This filter can be used to prevent the pricing summary being included in the output generated when using the {all_fields} merge tag. The pricing fields will be output just like the other form fields instead.

Usage

The following would apply to all forms:

add_filter( 'gform_display_product_summary', 'your_function_name', 10, 4 );

Parameters

  • $display_product_summary boolean

    Is the pricing summary table to be included in the {all_fields} output? Default is true.

  • $field Field Object

    The field currently being processed.

  • $form Form Object

    The form currently being processed.

  • $entry Entry Object

    The entry currently being processed.

Examples

1. Disable for all forms

This example shows how you can disable the pricing summary table for all forms.

add_filter( 'gform_display_product_summary', '__return_false' );

2. Disable for a specific form

add_filter( 'gform_display_product_summary', function( $display_product_summary, $field, $form, $entry ) {

    return rgar( $form, 'id' ) == 10 ? false : $display_product_summary;
}, 10, 4 );

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?

Source Code

apply_filters( 'gform_display_product_summary', true, $field, $form, $entry )

This filter is located in GFCommon::get_submitted_fields() and GFCommon::is_section_empty() in common.php

Since

This filter was added in Gravity Forms 1.8.8.