From: Steve Sutton Date: Tue, 31 Jul 2018 19:37:07 +0000 (-0400) Subject: Setup the use_billing flag. for updating billing data X-Git-Tag: v1.0.10^2~30 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=6847facda9909ee20871ed22423c2a4a9a14b5ed;p=WP-Plugins%2Fglm-member-db-billing.git Setup the use_billing flag. for updating billing data So if non of the boxes are checked then no update insert is done and the fields aren't required. --- diff --git a/classes/billingSupport.php b/classes/billingSupport.php index d8870fa..023280e 100644 --- a/classes/billingSupport.php +++ b/classes/billingSupport.php @@ -1583,8 +1583,9 @@ class GlmBillingSupport } } // Check to see if using contact or business address for billing - $contact_use_billing = filter_var( $_REQUEST['contact_use_billing'], FILTER_VALIDATE_BOOLEAN ); + $contact_use_billing = filter_var( $_REQUEST['contact_use_billing'], FILTER_VALIDATE_BOOLEAN ); $business_use_billing = filter_var( $_REQUEST['business_use_billing'], FILTER_VALIDATE_BOOLEAN ); + $use_billing = filter_var( $_REQUEST['use_billing'], FILTER_VALIDATE_BOOLEAN ); if ( $contact_use_billing ) { // Need to convert city to String $city_id = filter_var( $_REQUEST['city'], FILTER_VALIDATE_INT ); @@ -1645,7 +1646,7 @@ class GlmBillingSupport '%s', // country '%s', // zip ); - } else if ( !$contact_use_billing && !$business_use_billing ) { + } else if ( $use_billing ) { $billing_updated = array( 'email' => filter_var( $_REQUEST['billing_email'] ), 'billing_company' => filter_var( $_REQUEST['billing_company'] ),