Skip to content

Instantly share code, notes, and snippets.

@andrewlimaza
Created November 18, 2020 06:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewlimaza/06a624fa0752baf23dac75549d9d115c to your computer and use it in GitHub Desktop.
Save andrewlimaza/06a624fa0752baf23dac75549d9d115c to your computer and use it in GitHub Desktop.
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