Skip to content

Instantly share code, notes, and snippets.

@lorenzocaum
Last active April 30, 2016 16:57
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 lorenzocaum/a430f402df7bcbe7fe41ede036de01db to your computer and use it in GitHub Desktop.
Save lorenzocaum/a430f402df7bcbe7fe41ede036de01db to your computer and use it in GitHub Desktop.
How to set a language option for the PayPal Standard payment page in Event Espresso 3

There is a parameter that can be used to pick a language (localize) the payment page that registrants/attendees see when they go to pay with PayPal Standard. This can be setup by relocating a copy of the PayPal Standard payment gateway for Event Espresso 3 to a safe location and then making an edit. This ensures that this customization is not lost on a software update.

Using Event Espresso 4 for your project? Check out this tutorial instead: https://gist.github.com/joshfeck/6c37bc00ae0b301a53148444f3326817

  1. Ensure that you are running a current version of Event Espresso 3. You can see the changelog for Event Espresso 3 here:

https://eventespresso.com/wiki/change-log/

  1. Login to your WordPress site with an SFTP / FTP client. Cyberduck and FileZilla are free options. If you are on a Mac, then try Transmit.

  2. Browse to this location:

/wp-content/plugins/event-espresso/gateways/paypal

  1. Download a copy of the paypal folder to your computer

  2. Using your SFTP / FTP client, browse to this location:

/wp-content/uploads/espresso/gateways

  1. Now upload the paypal folder there

  2. Browse into the paypal folder that you just uploaded here:

/wp-content/uploads/espresso/gateways/paypal

  1. Look for the paypal_vars.php file and open it for editing.

  2. Around line 122, you'll see the following:

	$myPaypal->addField('currency_code', $paypal_cur);
	$myPaypal->addField('image_url', empty($paypal_settings['image_url']) ? '' : $paypal_settings['image_url']);
	$myPaypal->addField('no_shipping ', $no_shipping);
	$myPaypal->addField('first_name', $fname);
	$myPaypal->addField('last_name', $lname);
	$myPaypal->addField('email', $attendee_email);
	$myPaypal->addField('address1', $address);
	$myPaypal->addField('city', $city);
	$myPaypal->addField('state', $state);
	$myPaypal->addField('zip', $zip);
  1. Change it to this:
	$myPaypal->addField('currency_code', $paypal_cur);
	$myPaypal->addField('lc', 'GB');
	$myPaypal->addField('image_url', empty($paypal_settings['image_url']) ? '' : $paypal_settings['image_url']);
	$myPaypal->addField('no_shipping ', $no_shipping);
	$myPaypal->addField('first_name', $fname);
	$myPaypal->addField('last_name', $lname);
	$myPaypal->addField('email', $attendee_email);
	$myPaypal->addField('address1', $address);
	$myPaypal->addField('city', $city);
	$myPaypal->addField('state', $state);
	$myPaypal->addField('zip', $zip);
  1. Now you'll need to change GB (towards top of the sample code) which is the language code for United Kingdom (Great Britain) to your choice. These are available:

AU — Australia

AT — Austria

BE — Belgium

BR — Brazil

CA — Canada

CH — Switzerland

CN — China

DE — Germany

ES — Spain

GB — United Kingdom

FR — France

IT — Italy

NL — Netherlands

PL — Poland

PT — Portugal

RU — Russia

US — United States

For example, if you wanted to change the language to Spanish, then you could change GB in to ES.

  1. Save changes to the file

You can then try it out for yourself by registering for an event in a different web browser than what you are currently using. This will simulate a public registration similar to if a registrant/attendee registered for an event.