Support

Home Forums Event Espresso Premium How to add custom text to Reg. Approved & Ticket msgs for single Venue city

How to add custom text to Reg. Approved & Ticket msgs for single Venue city

Posted: July 27, 2017 at 10:07 am

Viewing 2 reply threads


mmccormick

July 27, 2017 at 10:07 am

I need to add a custom message to the Registration Approved and Ticket messages but only when the Venue is in London, England.

I have read about and installed the custom shortcode plugin from here: https://gist.github.com/Pebblo/e87cc8e30c4848dcdfe2

It is installed and activated. I need help with the syntax to return additional text only when the venue location is in London, England.

Does anyone have an example of how to access and check the venue object for the location?


Josh

  • Support Staff

July 27, 2017 at 2:09 pm

In Tony’s example on line 55 it returns the event ID:
return $event->ID();

You’ll replace what it returns with something like this:

$venues = $event->venues();
if ( is_array($venues)) {
  $venue = reset($venues);
  if ($venue instanceof EE_Venue) {
    $city = $venue->city();
    if ($city == 'London') {
      return 'Your custom message';
    }
  }
}


mmccormick

July 27, 2017 at 3:15 pm

Exactly what I needed! Thanks, Josh!

Viewing 2 reply threads

The support post ‘How to add custom text to Reg. Approved & Ticket msgs for single Venue city’ 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