Skip to content

Commit

Permalink
Fixed warning on Gift Level Integration
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
andrewlimaza committed Feb 3, 2022
1 parent 600fe1c commit 82f685e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/pmpro-gift-levels.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 82f685e

Please sign in to comment.