From 6847facda9909ee20871ed22423c2a4a9a14b5ed Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Tue, 31 Jul 2018 15:37:07 -0400 Subject: [PATCH] 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. --- classes/billingSupport.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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'] ), -- 2.17.1