0
add_filter( 'gform_field_value_bank20_code', 'my_custom_population_showcountry' );
function my_custom_population_showcountry( $value ) {
$current_user = wp_get_current_user();
$users = $current_user->PROCESSOR;

 // For the country Afghanistan
 if( $current_user->PROCESSOR == 'Afghanistan' )
$users = ( '500' );

// For the country Albania
if( $current_user->PROCESSOR == 'Albania' )
$users = ( '600' );

// For the country Algeria
if( $current_user->PROCESSOR == 'Algeria' )
$users = ( '600' );

// For the country American Samoa
if( $current_user->PROCESSOR == 'American Samoa' )
$users = ( '600' );


return $users;    
}

Now since we got it working with the above code, i will like us to add a google api currency rate or yahoo finance rate inside that number column so that the rates will be updated automatically, instead of using manual method to update. and this will be for each country.

pandglobal
  • 31
  • 1
  • 9
  • Your code block is broken up, can you edit your post to fix it? – Snuwerd Nov 25 '19 at 15:09
  • Also, what have you tried yourself? – Snuwerd Nov 25 '19 at 15:09
  • Am still stucked, i dont know where to get a valid google exchange rate api, the once i have are not working, once i get a working goodle or yahoo finance api i will know how to work arround adding them to the code above – pandglobal Nov 26 '19 at 11:46
  • I don't really understand what you're trying to achieve. First you speak off users which now are countries all of a sudden. And you speak of numbers, but now its about currency rate / finance rate. Rate of what? – Snuwerd Nov 26 '19 at 13:20
  • Lets just say i have archived all that i needed to archive progressively, except the one above, if i had stated the full process you will be twice confuse than you are now. So i break the challenges bit by bit – pandglobal Nov 26 '19 at 15:07
  • First, my challange was to get users meta outputted in the array, and through your aid i got it, secondly i ran some codes to convert users country meta key into numbers, i tried and figured it out, but then it leaves me with the option of manually changing the rates. So i now thought of using realtime exchange rates to put in place of the numbers, and by so doing i dont need to be manually updating the rate – pandglobal Nov 26 '19 at 15:08
  • So what i want is to get an exchange rate and then input each rate inside number column. Can you get me a simple php google api currency converter from USD to Eur and i will take it up from there – pandglobal Nov 26 '19 at 15:14
  • I don't think Google API works anymore, see https://stackoverflow.com/questions/3139879/how-do-i-get-currency-exchange-rates-via-an-api-such-as-google-finance – Snuwerd Nov 26 '19 at 18:43
  • I have signed up with fixer.io i want to use their api – pandglobal Nov 26 '19 at 18:46
  • I am sorry, I don't really have time right now. – Snuwerd Nov 26 '19 at 19:08

0 Answers0