Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save dwanjuki/ce7a8c662638bd00ec8ef8cbf9f7d985 to your computer and use it in GitHub Desktop.

Select an option

Save dwanjuki/ce7a8c662638bd00ec8ef8cbf9f7d985 to your computer and use it in GitHub Desktop.
Set language / locale for Stripe Checkout
<?php // copy from below.
/**
* Set Stripe Checkout language/locale.
*
* Possible locale values: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-locale
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_stripe_checkout_session_parameters_locale( $checkout_session_params, $morder ) {
$checkout_session_params['locale'] = 'es-419';
return $checkout_session_params;
}
add_filter( 'pmpro_stripe_checkout_session_parameters', 'my_pmpro_stripe_checkout_session_parameters_locale', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment