- Posts: 1
- Thank you received: 0
event capacity - sold out :: fully booked :: booked out
- Mario Hofer
- Topic Author
- Offline
- New Member
-
Less
More
6 years 8 months ago - 6 years 8 months ago #118742
by Mario Hofer
event capacity - sold out :: fully booked :: booked out was created by Mario Hofer
Hello,
how can I change the event capacity from "0" to "sold out/fully booked/booked out"? (frontend: event description)
best regards
homar
how can I change the event capacity from "0" to "sold out/fully booked/booked out"? (frontend: event description)
best regards
homar
Last edit: 6 years 8 months ago by Mario Hofer.
Please Log in or Create an account to join the conversation.
- James Riley
-
- Offline
- Platinum Member
-
6 years 8 months ago - 6 years 8 months ago #118750
by James Riley
James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.
Replied by James Riley on topic event capacity - sold out :: fully booked :: booked out
It's totally doable! You'll just have to add a few lines of custom code.
If you're site operates in just a single language, then you can simply insert the new text into your new code; if your site is multi-language, then you'll have to create a translation entry and use that Key instead of the hard-coded text (which I haven't covered here...)
For the sake of helping everyone to learn how to make changes like this, here's what I did:
1) Looking at a live event on the EventBooking demo site, I see that the default text attached to the desired Event Property is "Available Place", so I search BackEnd -> Components -> EventBooking -> Translation for "Available Place", and find that the Key for this text is "EB_AVAILABLE_PLACE". We'll need this key to find the right file & and line to edit.
2) Next, I search all the files contained within \components\com_eventbooking\view\ for "EB_AVAILABLE_PLACE". There are several hits. Let's make the change to the common\tmpl\event_properties.php template as I'm guessing that this where you want the new text to appear. You can add code to all the files, or just pick-and-choose the template view(s) that you actually use.
3) Open \components\com_eventbooking\view\common\tmpl\event_properties.php file and look for the line (line 164 on my copy) that reads:
Replace it with:
To keep the changed file from being overwritten during update, save your edited file to \templates\YOUR-TEMPLATE\html\com_eventbooking\common\event_properties.php. If editing a different file, of course use that file's filename.
4) Done! Test your change and make sure it works. If your change doesn't appears, clear your browser cache, your site cache, and/or your cloud cache (if you use a service like CloudFlare, Amazon, etc for caching).
If you're site operates in just a single language, then you can simply insert the new text into your new code; if your site is multi-language, then you'll have to create a translation entry and use that Key instead of the hard-coded text (which I haven't covered here...)
For the sake of helping everyone to learn how to make changes like this, here's what I did:
1) Looking at a live event on the EventBooking demo site, I see that the default text attached to the desired Event Property is "Available Place", so I search BackEnd -> Components -> EventBooking -> Translation for "Available Place", and find that the Key for this text is "EB_AVAILABLE_PLACE". We'll need this key to find the right file & and line to edit.
2) Next, I search all the files contained within \components\com_eventbooking\view\ for "EB_AVAILABLE_PLACE". There are several hits. Let's make the change to the common\tmpl\event_properties.php template as I'm guessing that this where you want the new text to appear. You can add code to all the files, or just pick-and-choose the template view(s) that you actually use.
3) Open \components\com_eventbooking\view\common\tmpl\event_properties.php file and look for the line (line 164 on my copy) that reads:
Code:
<?php echo $item->event_capacity - $item->total_registrants; ?>
Code:
<?php
if ($item->event_capacity - $item->total_registrants >0) { // if remaining places greater-than 0
echo $item->event_capacity - $item->total_registrants; // the original code
} else { // and if not greater-than 0
echo 'SOLD OUT'; // your custom text
}
?>
To keep the changed file from being overwritten during update, save your edited file to \templates\YOUR-TEMPLATE\html\com_eventbooking\common\event_properties.php. If editing a different file, of course use that file's filename.
4) Done! Test your change and make sure it works. If your change doesn't appears, clear your browser cache, your site cache, and/or your cloud cache (if you use a service like CloudFlare, Amazon, etc for caching).
James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.
Attachments:
Last edit: 6 years 8 months ago by James Riley. Reason: missed the PHP tags in the replacement code! / a couple other readability adjustments
The following user(s) said Thank You: Tuan Pham Ngoc
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
6 years 8 months ago #118752
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic event capacity - sold out :: fully booked :: booked out
@Mario Hofer: Please follow @James instructions to do the modification, it will work well
Regards,
Tuan
Regards,
Tuan
Please Log in or Create an account to join the conversation.
Moderators: Tuan Pham Ngoc
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.