show remaining spaces in calendar view

  • OTWD
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
8 years 4 months ago #106240 by OTWD
Hi,
I would like to show available places in the calendar monthly view to encourage people to book.
I dont believe there is a setting in EB that achieves this however was wondering if you could direct me to the correct file(s) to modify in order to echo this value.

Thanks

Success consists of going from failure to failure without loss of enthusiasm.

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

More
8 years 4 months ago #106241 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic show remaining spaces in calendar view
components/com_eventbooking/view/common/calendar.php

$event->event_capacity - $event->total_registrants should return the value you want to display

Tuan
The following user(s) said Thank You: OTWD

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

  • OTWD
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
8 years 4 months ago #106244 by OTWD
Replied by OTWD on topic show remaining spaces in calendar view
Fantastic thank you Tuan will report back here with my conclusions

Success consists of going from failure to failure without loss of enthusiasm.

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

More
8 years 4 months ago #106246 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic show remaining spaces in calendar view
OK. Maybe you could share the modified file here in case someone needs it

Tuan

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

  • OTWD
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
8 years 4 months ago - 8 years 4 months ago #106429 by OTWD
Replied by OTWD on topic show remaining spaces in calendar view
Here is the mod
public_html/templates/myTemplate/html/com_eventbooking/common/calendar.php
Line starting 145
Code:
<div class="date day_cell">" <!--<img border="0" align="top" title="<?php echo $event->title; ?>" src="<?php echo $thumbSource; ?>" />--> <!-- huw add text to calendar --> <span style="color:red;font-size:14px;"><?php echo "SPACES LEFT: ";?></span><span style="font-size:14px;"><?php echo $event->event_capacity - $event->total_registrants; ?></span><br/>

Success consists of going from failure to failure without loss of enthusiasm.
Last edit: 8 years 4 months ago by OTWD.

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

More
8 years 4 months ago #106452 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic show remaining spaces in calendar view
Thanks for sharing the code. Please note that this code is still wrong for event which has unlimited capacity. So maybe it is better to add a if command to only show spaces left if the event has limited capacity

Regards,

Tuan

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

Moderators: Tuan Pham Ngoc