Hi !
I used the filter gform_merge_tag_filter to exclude some fields from the notifaction mail, when i use the {all_fields} merge-tag.
But it's looks that this doesn't work with sections and product fields.
Any solution for this ?
Regards
Ralf
Hi !
I used the filter gform_merge_tag_filter to exclude some fields from the notifaction mail, when i use the {all_fields} merge-tag.
But it's looks that this doesn't work with sections and product fields.
Any solution for this ?
Regards
Ralf
No Response to this ?
Hm.
5 Days are gone since i posted this message.
Is there no support on bugs ?
And by the way.
The example from http://www.gravityhelp.com/documentation/page/Gform_merge_tag_filter
also doesn't work.
Any news to this ?
Ralf, can you share a code snippet that you are using, or trying to use?
Hi !
Of coure. No Problem.
I added a new settings field to all field-types "excludeField".
At this field the user could select if the field should be included or not when the {all_fields} tag is used at the notification settings.
(i have to do this in case there is no hook to extend the notification form)
And now i look, if this field is checked or not.
public function sp_gform_merge_tag_filter($value, $merge_tag, $options, $field)
{
if ( $merge_tag == "all_fields" ) {
if ( $field['excludeField'] == "1" )
return false;
}
return $value;
}
Thats all.
But sections and product fields are not excluded from the email.
In the routines to display this field-types there is no filter at the GF core code.
Regards
Ralf
Why i don't get an email about your response, even i checked the "subsribe to this topic..." ?
See my forum entry where i ask to extend the notification form (without any response)
http://www.gravityhelp.com/forums/topic/filters-to-extend-notifications-form
You could find the code at the common.php at the function 'get_submitted_fields', starting at line 776 (release 1.6.3.2.1).
There is a switch to choose sections, captcha, password and all other field-types.
But at the 'sections' section the filter isn't used, so the filter can't work.
There is also a comment
//ignore product fields as they will be grouped together at the end of the grid
so the filter also can't work at all product fields.
Product fields will be handled by "get_submitted_pricing_fields". But in this function there isn't any filter.
At Line 843 at common.php you could also see that your example can'T work.
$field_value = apply_filters("gform_merge_tag_filter", $field_value, $merge_tag, $options, $field);
If you don't return a value, nothing will be displayed. And in your example you return false at hidden fields (this will not displayed) and nothing for all other fields, so this will also not displayed. So nothing will be displayed.
Hope this helps.
Regards
Ralf
Any Idea ?
Hello !
Any answer ??
I am taking a closer look at this and will keep you posted.
This would be nice (after 3 weeks)
Hello Ralf,
I was able to add the filter to the section so that you can disable it. Email me to alex@rocketgenius.com and I will send you a version with that change. Unfortunately I wasn't able to add support for the product fields. I don't see that being very useful as the product fields should really be displayed as a group since they need to add up to the total price. I could consider adding support for disabling the entire order section. If that would be useful to you, let me know I and will add that in for you.
I have also updated the example on the documentation page. It did have an issue.
http://www.gravityhelp.com/documentation/page/Gform_merge_tag_filter
Hi Alex !
Yes. It would be usefull to disable the full product section.
But how would this work ?
Will this changes be in the next GF update ?
Regards
Ralf
I still have to figure out how it will work. Did the section filter change I sent you via email worked for you?
Hi !
At first : thank's for the support and the fixes.
Hm. I don't get an email.
Could you resend the mail ?
Regards
Ralf