gform_display_product_summary

gform_display_product_summary

DescriptionUsageParametersExamples1. Disable for all forms2. Disable for a specific formPlacementSource CodeSince

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:
1add_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.
1add_filter( 'gform_display_product_summary', '__return_false' );
2. Disable for a specific form
1234add_filter( 'gform_display_product_summary', function( $display_product_summary, $field, $form, $entry ) {     return $form['id'] == 10 ? false : $display_product_summary;}, 10, 4 );
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
1apply_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.

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注