Support

Home Forums Event Espresso Premium Setting a Default Country Value

Setting a Default Country Value

Posted: March 21, 2014 at 8:42 am


SWTA

March 21, 2014 at 8:42 am

Hi Support

We would like pass a default country value through to worldpay when making a payment (99.9% of our customers are UK based).

The tag we would like to pass is:
<input type=”hidden” value=”GB” name=”country”>

Manually adding this to the payment overview page (using firebug) works perfectly but we are unsure where to edit the actual payment form to make this change permanent.

Many thanks
Michael


Tony

  • Support Staff

March 21, 2014 at 9:10 am

Hi Michael,

You can add this to the WorldPay payment gateway itself.

Go to plugins/event-espresso/gateways/ and copy the WorldPay directory.

Upload that to wp-conent/uploads/espresso/gateways/

Within that new directory open up worldpay_vars.php and add:

$myworldpay->addField('country', 'GB');

I added this around line 30, straight after the line:

$myworldpay->addField('MC_callback', get_permalink($org_options['return_url']));

This will then output something like this when selecting WorldPay as a payment option. http://take.ms/5c5IQ

Hope that helps ๐Ÿ™‚


SWTA

March 21, 2014 at 9:38 am

Hi Tony

Works perfectly ๐Ÿ™‚

Thank you!

The support post ‘Setting a Default Country Value’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso