ProductField
Gravity Forms' default export isn't always consistent or useful for Excel. That's why we've
created this class. It is responsible for these fields: singleproduct
and calculation
. Both of them are products,
and the export returns a quantity and a price. And when you export with separated fields, there's no problem. But when
you want all that info in one field, it's kind of mushed together. So this field tries to offer you a nice default, as
well as a filter to overwrite it.
Filters
gfexcel_field_*type*_prepend_{form_id}_{input_id}
In this filter, the*type*
part should be replace by eithersingleproduct
orcalculation
. It gives you the ability to prepend the value of the individual data, likeQty
andPrice
.Example
add_filter('gfexcel_field_singleproduct_prepend', function($prepend, $input_id) { // $input_id is the id of the input in the field, so not the field_id if($input_id === 3) { // 3 happens to be the key for Quantity, `Qty: ` by default. $prepend = "Amount: "; } return $prepend; }, 10, 2);