Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Set 2Checkout hosted checkout page language for Paid Memberships Pro.
<?php
/**
* Change the 2Checkout hosted checkout default language for Paid Memberships Pro WordPress Plugin.
* Please see https://www.2checkout.com/documentation/checkout/parameter-sets/pass-through-products/ (Additional Parameters) for available languages.
*
* 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_change_2co_locale( $twoco_url, $order ) {
$twoco_url .= '&lang=es_ib';
return $twoco_url;
}
add_filter( 'pmpro_twocheckout_ptpstr', 'my_pmpro_change_2co_locale', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment