From 839553c487e1f40161c348ddf0806639012988b0 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Tue, 7 Aug 2018 11:33:16 -0400 Subject: [PATCH] Update for billing in contact export. Filters for adding billing to the contact exports. --- setup/adminHooks.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/setup/adminHooks.php b/setup/adminHooks.php index 066ac8f..a906fe8 100644 --- a/setup/adminHooks.php +++ b/setup/adminHooks.php @@ -129,3 +129,38 @@ add_filter( return $BillingSupport->saveContactBillingData( $ref_dest ); }, 10, 1 ); + +/** + * Filter for the billing fields + */ +add_filter( + 'glm-member-db-billing-get-fields', + function( $content ){ + return array( + 'renewal_date' => 'Renewal Date', + 'billing_fname' => 'Billing First Name', + 'billing_lname' => 'Billing Last Name', + 'billing_addr1' => 'Billing Address 1', + 'billing_addr2' => 'Billing Address 2', + 'billing_city' => 'Billing City', + 'billing_state' => 'Billing State', + 'billing_zip' => 'Billing Zip', + 'billing_country' => 'Billing Country', + 'billing_phone' => 'Billing Phone', + 'billing_fax' => 'Billing Fax', + ); + }, 10, 1 +); + +/** + * Filter for getting billing field for a member + */ +add_filter( + 'glm-member-db-billing-get-data', + function( $ref_dest ){ + // Get billing info for $ref_dest. + require_once GLM_MEMBERS_BILLING_PLUGIN_CLASS_PATH . '/billingSupport.php'; + $BillingSupport = new GlmBillingSupport( $this->wpdb, $this->config ); + return $BillingSupport->getAccountByRefDest( $ref_dest ); + }, 10, 1 +); -- 2.17.1