[Membership 2 Pro] add payment currency

i need to add CLP (chilean) currency, how to?

  • Ash

    Hello Marcel

    You can try the following code:

    add_filter( 'membership_available_currencies', 'membership_available_currencies_cb' );
    function membership_available_currencies_cb( $arr ){
    	$arr['CLP'] = 'CLP - Chilean CURRENCY NAME';
    	return $arr;
    }

    Change the name and currency symbol as per your need.

    You can use this code in your child theme's functions.php if the theme is not changed. Otherwise mu-plugin is the best option. To create a mu-plugin, go to wp-content/mu-plugins folder. If there is no mu-plugins folder then, create one. Now, inside the mu-plugins folder create file with name anything.php (make sure file extension is .php). Now start with a <?php tag and then put the above code.

    Hope it helps! Please feel free to ask more questions if you have any.

    Have a nice day!

    Cheers,
    Ash

  • Marcel

    Hi,

    i created the folder and file, inside the file added this:

    <?php
    
    add_filter( 'membership_available_currencies', 'membership_available_currencies_cb' );
    function membership_available_currencies_cb( $arr ){
    	$arr['CLP'] = 'CLP - Chilean $';
    	return $arr;
    }
    
    ?>

    but am not able to use this currency from membership, payment, Select payment currency:
    CLP is not there, also for CLP the numbers should return like this for example: $100.000

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.