Support

Home Forums Event Espresso Premium Multi Currency/Multi Site

Multi Currency/Multi Site

Posted: March 4, 2019 at 4:18 pm


jakelunniss

March 4, 2019 at 4:18 pm

Hello!

We currently regularly run multiple events in multiple countries, in at least four currencies.

I’ve done some digging in the forums and figured that the best way to achieve this is multisite with multiple sub-driectories, i.e. mainsite.com/au; mainsite.com/us; mainsite.com/en; mainsite.com/eu; etc etc.

I understand there’s a bit of weirdness with auto updates and that’s no big deal.

However what I can’t find anything about is having ALL events listed on the mainsite.

Is it possible to have all events across the subsites appear in chronological, filterable order on the mainsite? And if so, how?

Many thanks!

Jake


Josh

  • Support Staff

March 5, 2019 at 9:03 am

Hi Jake,

Actually if you use WordPress multisite, then you only have one copy of the plugin, so you only update once (via the network’s plugin page). Your support license key will go on the main site’s Event Espresso > General Settings page.

With regards to a list of all events from all sites, this is something that’s possible with custom coding where you pull all the events via requests to the REST API.

Here’s an example of some custom code that adds support for a new shortcode that will display events from one other site:
https://github.com/eventespresso/ee-code-snippet-library/blob/master/shortcodes/jf_other_site_event_list.php

You can add the above to a functions plugin and activate the plugin on the main site.

The above shortcode only pulls events from one site at a time, but with some extra custom coding it could be adapted to pull in additional sites.


jakelunniss

March 5, 2019 at 1:04 pm

Josh, you are a wonderful, wonderful man.


jakelunniss

March 8, 2019 at 5:50 pm

Hey Josh,

I’ve tried to modify the shortcode to use the featured image URL as the background for the div:

$featured_image_url = $event['_calculated_fields']['image_medium_large']['url'];
$html .= $featured_image_url ? '<div class="embedded-event" style="background-image: url("' . esc_url( $featured_image_url ) . '")>' : '';'

but in the on-page html the url is coming through with the slashses removed:

<div class="embedded-event" style="background-image: url(" http:="" janedev.jakelunniss.com="" us="" wp-content="" uploads="" 2019="" 03="" tour_1-768x448.jpg")="">

How do I keep the encoding? I figured it would work because it doesn’t have a problem with the <img src= use on line 28 of the original shortcode. I figured wrong lol…


Josh

  • Support Staff

March 11, 2019 at 10:48 am

Hi Jake,

It looks like the mismatched single/double quotes need to be cleaned up:

$featured_image_url = $event['_calculated_fields']['image_medium_large']['url'];
$html .= $featured_image_url ? '<div class="embedded-event" style="background-image: url(' . esc_url( $featured_image_url ) . ')">' : '';

As aside: if there happens to be an event without a featured image you probably still want to add an opening div, which can be done by changing the line to:

$featured_image_url = $event['_calculated_fields']['image_medium_large']['url'];
$html .= $featured_image_url ? '<div class="embedded-event" style="background-image: url(' . esc_url( $featured_image_url ) . ')">' : '<div class="embedded-event">';


jakelunniss

March 11, 2019 at 12:00 pm

Thanks Josh! We’re getting real close to this thing dancing and making coffee. EE is an awesome product.


Josh

  • Support Staff

March 11, 2019 at 12:18 pm

Awesome to hear Jake. If you have a moment would you like to leave a review about Event Espresso on WordPress.org?

https://wordpress.org/support/plugin/event-espresso-decaf/reviews/

The support post ‘Multi Currency/Multi Site’ 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