GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
product.php
Go to the documentation of this file.
1 <?php
2 /**
3  * Display the product field type
4  *
5  * @package GravityView
6  * @subpackage GravityView/templates/fields
7  *
8  * @global string $display_value Existing value
9  * @global string|array $value
10  */
11 
13 
14 extract( $gravityview_view->getCurrentField() );
15 
16 /**
17  * See if there are any values in the product array GF provides. (product name, quantity, price)
18  *
19  * If not, Gravity Forms displays a useless string (", Qty: , Price:") instead of an empty value. This prevents
20  * the "Hide empty fields" setting from working.
21  *
22  * @since 1.12
23  */
24 $value = is_array( $value ) ? array_filter( $value, 'gravityview_is_not_empty_string' ) : $value;
25 
26 // If so, then we have something worth showing
27 if ( !empty( $value ) ) {
28 
30 
32 
33  switch ( $input_id ) {
34  case 2:
35  $output = GFCommon::to_money( $output, \GV\Utils::get( $entry, 'currency' ) );
36  break;
37  case 3:
38  $output = GFCommon::to_number( $output );
39  break;
40  }
41 
42  echo $output;
43 }
gravityview_get_field_value( $entry, $field_id, $display_value)
Handle getting values for complex Gravity Forms fields.
Definition: class-api.php:1034
static getInstance( $passed_post=NULL)
$display_value
gravityview_get_input_id_from_id( $field_id='')
Very commonly needed: get the # of the input based on a full field ID.
$gravityview_view
Definition: product.php:12
$entry
Definition: notes.php:27
if(false !==strpos( $value, '00:00')) $field_id
string $field_id ID of the field being displayed
Definition: time.php:22
$value
See if there are any values in the product array GF provides.
Definition: product.php:24