wallet->balance( $user_id ); break; } $current_balance = $formatted ? affwp_currency_filter( affwp_format_amount( $current_balance ) ) : floatval( $current_balance ); return $current_balance; } /** * Get the Active Integration * * Prioritizes WooCommerce over EDD. * * @since 2.6.0 * * @return string Empty if none. */ function affiliatewp_store_credit_get_active_integration() : string { $enabled_integrations = array_keys( affiliate_wp()->integrations->get_enabled_integrations() ); if ( class_exists( 'AffiliateWP_Store_Credit_WooCommerce' ) // And they actually enabled the WooCommerce integration. && in_array( 'woocommerce', $enabled_integrations, true ) ) { return 'woocommerce'; } elseif ( class_exists( 'AffiliateWP_Store_Credit_EDD' ) && class_exists( 'EDD_Wallet' ) // And they actually enabled the EDD integration. && in_array( 'edd', $enabled_integrations, true ) ) { return 'edd'; } return ''; }