bookmark_bordergform_product_price

Description

Use this filter to change the sub-label for the Product Price input.

Usage

The following would apply to all forms:

add_filter( 'gform_product_price', 'your_function_name', 10, 2 );

You can also target a specific form by adding the form id after the hook name. (format: gform_product_price_FORMID)

add_filter( 'gform_product_price_6', 'your_function_name', 10, 2 );

Parameters

  • $sublabel string

    The sub-label to be filtered

  • $form_id integer

    ID of current form.

Examples

This example changes the price sub-label to “Cost:”.

add_filter( 'gform_product_price_185', 'set_price_label', 10, 2 );
function set_price_label( $sublabel, $form_id ) {
    return 'Cost';
}

Please note: The colon will be added automatically after the label.

Placement

This code should be placed in the functions.php file of your active theme.

Source Code

This filter is located in the following methods:

  • GFCommon::get_submitted_pricing_fields() in common.php
  • GFEntryDetail::lead_detail_grid() in entry_detail.php
  • GF_Field_Calculation::get_field_input() in includes/fields/class-gf-field-calculation.php
  • GF_Field_SingleProduct::get_field_input() in includes/fields/class-gf-field-singleproduct.php