Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gpnf-delay-child-notifications-for-parent-payment.php: Added send notification if no payment status for parent entry. #976

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Plugin URI: http://gravitywiz.com/documentation/gravity-forms-nested-forms/
* Description: Delay GP Nested Forms child form notification until payment processing is completed.
* Author: Gravity Wiz
* Version: 1.1
* Version: 1.1.1
* Author URI: http://gravitywiz.com
*/
class GW_GPNF_Delay_Child_Notifications {
Expand Down Expand Up @@ -43,12 +43,13 @@ public function init() {

public function gpnf_should_send_notification( $should_send_notification, $notification, $context, $parent_form, $nested_form_field, $entry, $child_form ) {
if ( $context === 'parent' && $this->is_applicable_form( $parent_form['id'] ) ) {
$parent_entry = GFAPI::get_entry( rgar( $entry, 'gpnf_entry_parent' ) );
$should_send_notification = in_array( rgar( $parent_entry, 'payment_status' ), array( 'Paid', 'Active' ), true );
$parent_entry = GFAPI::get_entry( rgar( $entry, 'gpnf_entry_parent' ) );
$payment_status = rgar( $parent_entry, 'payment_status', '' );
malayladu marked this conversation as resolved.
Show resolved Hide resolved

$should_send_notification = in_array( $payment_status, array( '', 'Paid', 'Active' ), true );
}

return $should_send_notification;

}

public function gform_post_payment_completed( $entry ) {
Expand Down
Loading