Skip to content

Commit 75972de

Browse files
committed
gpnf-delay-child-notifications-for-parent-payment.php: Added send notification if no payment status for parent entry.
1 parent 30ce736 commit 75972de

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

gp-nested-forms/gpnf-delay-child-notifications-for-parent-payment.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Plugin URI: http://gravitywiz.com/documentation/gravity-forms-nested-forms/
1010
* Description: Delay GP Nested Forms child form notification until payment processing is completed.
1111
* Author: Gravity Wiz
12-
* Version: 1.1
12+
* Version: 1.1.1
1313
* Author URI: http://gravitywiz.com
1414
*/
1515
class GW_GPNF_Delay_Child_Notifications {
@@ -43,12 +43,13 @@ public function init() {
4343

4444
public function gpnf_should_send_notification( $should_send_notification, $notification, $context, $parent_form, $nested_form_field, $entry, $child_form ) {
4545
if ( $context === 'parent' && $this->is_applicable_form( $parent_form['id'] ) ) {
46-
$parent_entry = GFAPI::get_entry( rgar( $entry, 'gpnf_entry_parent' ) );
47-
$should_send_notification = in_array( rgar( $parent_entry, 'payment_status' ), array( 'Paid', 'Active' ), true );
46+
$parent_entry = GFAPI::get_entry( rgar( $entry, 'gpnf_entry_parent' ) );
47+
$payment_status = rgar( $parent_entry, 'payment_status', '' );
48+
49+
$should_send_notification = in_array( $payment_status, array( '', 'Paid', 'Active' ), true );
4850
}
4951

5052
return $should_send_notification;
51-
5253
}
5354

5455
public function gform_post_payment_completed( $entry ) {

0 commit comments

Comments
 (0)