Display Events Location on Registration pages

  • chris
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
11 years 9 months ago - 11 years 9 months ago #44712 by chris
Hello -

Does anyone know how to get the Event Location Name to display on the Event Registration pages as well as the confirmation pages in Event Booking 1.6.2. I have been able to get the Event Title and Date to display via adding some code and modifying the area where the $msg is displayed on the register and confirmation views using html overrides. But I'm struggling to get the Event Location Name to display. Everything I have tried will return NULL If I var_dump($this->location->name) I have tried other variations like $item->event->location->name, $item->location->name... I'm able to get the location id to display using var_dump($this->event->location_id) but not the name. I'm sure I'm missing something simple to get this working.

If anyone know of way to get the Event Location Name to display on the registration pages and various other registration/confirmation screens please let me know.
- Thanks in advance - Chris
Last edit: 11 years 9 months ago by chris. Reason: icon

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago #44719 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Display Events Location on Registration pages
Hi Chris

There is no location information available on the registration page, so you will need to write code to get it. In that file, you can try to use code below:
Code:
$db = JFactory::getDbo(); $sql = 'SELECT * FROM #__eb_locations WHERE id='.$this->event->location_id; $db->setQuery($sql); $location = $db->loadObject(); echo $location->name;

That code like that will allow you to get location information !

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • chris
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
11 years 9 months ago #44761 by chris
Tuan -

Thank you for you help. I added the query to the db and it does work on the individual registration pages and group billing however is it possible to get this to work on the group member registration page? I tried to formulate a similar query but no luck.

Thanks in advance!

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago #44799 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Display Events Location on Registration pages
Hi Chris

In the group member page, you will need to use a different code:
Code:
$db = JFactory::getDbo(); $sql = 'SELECT a.* FROM #__eb_locations AS a INNER JOIN #__eb_events AS b ON a.id = b.location_id WHERE b.id='.$this->eventId; $db->setQuery($sql); $location = $db->loadObject(); echo $location->name;

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • chris
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
11 years 9 months ago #44843 by chris
Tuan -

Thanks, this works well enough for what I needed. I also added this code below to display event data on the group member pages in addition to location data. Here is your query modified to show event data, for anyone else that may want to do the same thing.
Code:
$db = JFactory::getDbo(); $sql = 'SELECT a.* FROM #__eb_events AS a LEFT JOIN #__eb_locations AS b ON b.id = a.location_id WHERE a.id='.$this->eventId; $db->setQuery($sql); $theEvent = $db->loadObject(); $myEventTitle = $theEvent->title;

Hope this helps anyone else out there. Thanks again Tuan.
- Chris

Please Log in or Create an account to join the conversation.

More
11 years 8 months ago #44864 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Display Events Location on Registration pages
OK Chris. Thanks for the update and sharing the code !

Tuan

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc