From 82f685eb506acce72cdb3fbfd95340d9aef85568 Mon Sep 17 00:00:00 2001 From: Andrew Lima Date: Thu, 3 Feb 2022 12:56:24 +0200 Subject: [PATCH] Fixed warning on Gift Level Integration Fixed warning for Gift Level integration when trying to add a product to your cart from the shop page that is tied to the Gift Membership Add On. --- includes/pmpro-gift-levels.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/pmpro-gift-levels.php b/includes/pmpro-gift-levels.php index 6aa0981..3958fc8 100644 --- a/includes/pmpro-gift-levels.php +++ b/includes/pmpro-gift-levels.php @@ -99,11 +99,11 @@ function pmprowoo_gift_levels_recipient_fields_validation($passed, $product_id) $gift_membership_email_option = get_post_meta($product_id, '_gift_membership_email_option', true); if(!empty($gift_membership_code) && !empty($gift_membership_email_option)){ - if($gift_membership_email_option == '3' && $_REQUEST['gift-send-email'] == ''){ + if($gift_membership_email_option == '3' && ( ! isset( $_REQUEST['gift-send-email'] ) || $_REQUEST['gift-send-email'] == '' ) ){ wc_add_notice( __( 'Please select option for Send Email to Recipient', 'pmpro-woocommerce' ), 'error' ); return false; } - if(($gift_membership_email_option == '1') || ($_REQUEST['gift-send-email'] == '1')){ + if(($gift_membership_email_option == '1') || ( $_REQUEST['gift-send-email'] == '1' ) ){ if ( empty( $_REQUEST['gift-recipient-name'] ) ) { wc_add_notice( __( 'Please enter a NAME of Recipient', 'pmpro-woocommerce' ), 'error' ); return false;