Skip to content

Instantly share code, notes, and snippets.

@andrewlimaza
Last active January 23, 2020 07:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewlimaza/35074f0948f87d14b93bddbd418166cb to your computer and use it in GitHub Desktop.
Save andrewlimaza/35074f0948f87d14b93bddbd418166cb to your computer and use it in GitHub Desktop.
Adjust currency for Paid Memberships Pro
<?php
/**
* Adjust Euros for Paid Memberships Pro. Add correct thousands and decimal separator. (i.e. 1.500,99)
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_eu_format( $pmpro_currencies ) {
$pmpro_currencies['EUR'] = array(
'decimals' => '2',
'thousands_separator' => '.',
'decimal_separator' => ',',
'name' => __('Euros (&euro;)', 'paid-memberships-pro' ),
'symbol' => '&euro;',
'position' => apply_filters("pmpro_euro_position", pmpro_euro_position_from_locale())
);
return $pmpro_currencies;
}
add_filter( 'pmpro_currencies', 'my_pmpro_eu_format' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment