Price and register button in module
- James Riley
-
- Offline
- Platinum Member
-
Less
More
8 years 3 months ago #93162
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 Price and register button in module
I was thinking about adding these buttons the other day to my site, but ran out of time that day...
... and I'm pretty sure now that I won't try it.
Looking through the code just now, OS Solution has built in A LOT of toggles and controls around the button code (eg: Is registration open? Is the event full? Is there a waiting list? Is registration type Individual, Group or both? Is the Ticket Type plugin needed? Etc.)
Properly implementing the Register buttons could take a lot of work... Maybe @Tuan has a magic way of doing this easily (the common > buttons.php template??), but it looks like a lot of the aforementioned condition processing happens within other view files.
I'm just going to stick with my "REGISTER / MORE INFO" button. It means 1 more click and some scrolling for the user, but it's what they're going to have to do for now!
... and I'm pretty sure now that I won't try it.
Looking through the code just now, OS Solution has built in A LOT of toggles and controls around the button code (eg: Is registration open? Is the event full? Is there a waiting list? Is registration type Individual, Group or both? Is the Ticket Type plugin needed? Etc.)
Properly implementing the Register buttons could take a lot of work... Maybe @Tuan has a magic way of doing this easily (the common > buttons.php template??), but it looks like a lot of the aforementioned condition processing happens within other view files.
I'm just going to stick with my "REGISTER / MORE INFO" button. It means 1 more click and some scrolling for the user, but it's what they're going to have to do for now!
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 :.
Please Log in or Create an account to join the conversation.
- Matj
- Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 112
- Thank you received: 0
8 years 3 months ago #93164
by Matj
Replied by Matj on topic Price and register button in module
Ok. Thank you for your help. We wait for Tuan then.
This is what I have now. Maybe will help someone. I have use bootstrap 3 and some custom css, so it looks almost identical to timeline view.
This is what I have now. Maybe will help someone. I have use bootstrap 3 and some custom css, so it looks almost identical to timeline view.
Code:
<?php
/**
* @package Joomla
* @subpackage Event Booking
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2010 - 2017 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
// no direct access
defined('_JEXEC') or die;
JHtml::_('script', JUri::root().'media/com_eventbooking/assets/js/noconflict.js', false, false);
if ($showLocation)
{
$width = (int) $config->map_width ;
if (!$width)
{
$width = 800 ;
}
$height = (int) $config->map_height ;
if (!$height)
{
$height = 600 ;
}
$deviceType = EventbookingHelper::getDeviceType();
if ($deviceType == 'mobile')
{
EventbookingHelperJquery::colorbox('eb-colorbox-map', '100%', $height . 'px', 'true', 'false');
}
else
{
EventbookingHelperJquery::colorbox('eb-colorbox-map', $width . 'px', $height . 'px', 'true', 'false');
}
}
if (count($rows))
{
$monthNames = array(
1 => JText::_('EB_JAN_SHORT'),
2 => JText::_('EB_FEB_SHORT'),
3 => JText::_('EB_MARCH_SHORT'),
4 => JText::_('EB_APR_SHORT'),
5 => JText::_('EB_MAY_SHORT'),
6 => JText::_('EB_JUNE_SHORT'),
7 => JText::_('EB_JULY_SHORT'),
8 => JText::_('EB_AUG_SHORT'),
9 => JText::_('EB_SEP_SHORT'),
10 => JText::_('EB_OCT_SHORT'),
11 => JText::_('EB_NOV_SHORT'),
12 => JText::_('EB_DEC_SHORT')
);
?>
<div class="eb-event-list timeline-mod">
<ul class="eventsmall">
<?php
$k = 0 ;
$baseUri = JUri::base(true);
foreach ($rows as $row)
{
$k = 1 - $k ;
$date = JHtml::_('date', $row->event_date, 'd', null);
$month = JHtml::_('date', $row->event_date, 'n', null);
?>
<li class="vevent clearfix row">
<div class="col-sm-1">
<span class="event-date">
<?php
if ($row->event_date == '2099-12-31 00:00:00')
{
echo JText::_('EB_TBC');
}
else
{
?>
<span title="">
<span class="month"><?php echo $monthNames[$month];?></span>
<span class="day"><?php echo $date; ?></span>
</span>
<?php
}
?>
</span>
</div>
<div class="col-sm-3">
<a class="img-link eb-event-link" href="<?php echo JRoute::_(EventbookingHelperRoute::getEventRoute($row->id, 0, $itemId), false); ?>">
<?php
if ($showThumb && $row->thumb && file_exists(JPATH_ROOT.'/media/com_eventbooking/images/thumbs/'.$row->thumb))
{
?>
<img src="<?php echo $baseUri . '/media/com_eventbooking/images/thumbs/' . $row->thumb; ?>" class="eb_event_thumb" />
<?php
}
?>
</a>
</div>
<div class="col-sm-8">
<a class="url eb-event-link" href="<?php echo JRoute::_(EventbookingHelperRoute::getEventRoute($row->id, 0, $itemId), false); ?>">
<h3 class="summary"><?php echo $row->title ; ?></h3>
</a>
<div class="eb-event-price-container btn-primary"><span class="eb-individual-price"><?php
if ($row->price_text)
{
echo $row->price_text;
}
elseif ($row->individual_price > 0)
{
echo EventbookingHelper::formatCurrency($row->individual_price, $config, $row->currency_symbol);
}
else
{
echo '<span class="eb_free">' . JText::_('EB_FREE') . '</span>';
}
?></span>
</div>
<span class="event_date"><i class="fa fa-calendar" aria-hidden="true"></i>
<?php
if ($row->event_date == '2099-12-31 00:00:00')
{
echo JText::_('EB_TBC');
}
else
{
echo JHtml::_('date', $row->event_date, $config->event_date_format, null);
}
?>
</span>
<?php
if ($showCategory)
{
?>
<p><small title="<?php echo JText::_('EB_CATEGORY'); ?>" class="category"><span>
<i class="icon-folder-open"></i>
<?php echo $row->categories ; ?></span></small></p>
<?php
}
if ($showLocation && strlen($row->location_name))
{
?>
<p title="<?php echo JText::_('EB_LOCATION'); ?>" class="location">
<i class="fa fa-map-marker" aria-hidden="true"></i>
<a href="<?php echo JRoute::_('index.php?option=com_eventbooking&view=map&location_id='.$row->location_id.'&tmpl=component&format=html&Itemid='.$itemId); ?>" class="eb-colorbox-map"
<strong><?php echo $row->location_name ; ?></strong>
</a></p>
<div class="mod_eb_description"><?php echo $row->short_description; ?></div>
<a class="btn btn-default btn-primary" href="<?php echo JRoute::_(EventbookingHelperRoute::getEventRoute($row->id, 0, $itemId), false); ?>">
<?php echo JText::_('EB_DETAILS'); ?>
</a>
<?php
}
?>
</div>
</li>
<?php
}
?>
</ul>
</div>
<?php
}
else
{
?>
<div class="eb_empty"><?php echo JText::_('EB_NO_UPCOMING_EVENTS') ?></div>
<?php
}
?>
Please Log in or Create an account to join the conversation.
- Matj
- Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 112
- Thank you received: 0
8 years 2 months ago #94160
by Matj
Replied by Matj on topic Price and register button in module
Im happy with this override, but need some price customization.
Now I have
It shows price, entered in event config. I need to show discounted price with all discount (discount, early bird...) dedacted.
I tryed $row->discounted_price, but its not working. Any sugestions?
Thank you
Now I have
Code:
<span class="eb-individual-price"><?php
if ($row->price_text)
{
echo $row->price_text;
}
elseif ($row->individual_price > 0)
{
echo EventbookingHelper::formatCurrency($row->individual_price, $config, $row->currency_symbol);
}
else
{
echo '<span class="eb_free">' . JText::_('EB_FREE') . '</span>';
}
?></span>
It shows price, entered in event config. I need to show discounted price with all discount (discount, early bird...) dedacted.
I tryed $row->discounted_price, but its not working. Any sugestions?
Thank you
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
8 years 2 months ago #94176
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Price and register button in module
If you want to have discounted_price available, you would need to add some more code. Try the instructions below (untested):
1. Open the file modules/mod_eb_events/mod_eb_events.php
2. Find this line of code:
$rows = $db->loadObjectList();
3. Change it to:
$rows = $db->loadObjectList();
require_once JPATH_ROOT . '/components/com_eventbooking/helper/data.php';
EventbookingHelperData::preProcessEventData($rows, 'list');
Tren try again, the discounted_price data should be available
Tuan
1. Open the file modules/mod_eb_events/mod_eb_events.php
2. Find this line of code:
$rows = $db->loadObjectList();
3. Change it to:
$rows = $db->loadObjectList();
require_once JPATH_ROOT . '/components/com_eventbooking/helper/data.php';
EventbookingHelperData::preProcessEventData($rows, 'list');
Tren try again, the discounted_price data should be available
Tuan
Please Log in or Create an account to join the conversation.
- Matj
- Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 112
- Thank you received: 0
8 years 2 months ago #94190
by Matj
Replied by Matj on topic Price and register button in module
Great, thats working. Thank you.
Will that be in next update or I must take care at update?
Will that be in next update or I must take care at update?
Please Log in or Create an account to join the conversation.
- Matj
- Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 112
- Thank you received: 0
8 years 2 months ago #94191
by Matj
Replied by Matj on topic Price and register button in module
Any ideas how to format date without time?
Code:
<span class="event_date"><i class="fa fa-calendar" aria-hidden="true"></i>
<?php
if ($row->event_date == '2099-12-31 00:00:00')
{
echo JText::_('EB_TBC');
}
else
{
echo JHtml::_('date', $row->event_date, $config->event_date_format, null);
}
?>
</span>
Please Log in or Create an account to join the conversation.
- James Riley
-
- Offline
- Platinum Member
-
8 years 2 months ago - 8 years 2 months ago #94194
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 Price and register button in module
Replace the "$config->event_date_format" with a date format string (eg: "M. j, Y" for "Feb. 12, 2017"; see
php.net/manual/en/function.date.php
for all format codes).
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 :.
Last edit: 8 years 2 months ago by James Riley.
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
-
8 years 2 months ago #94199
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Price and register button in module
At the moment, I haven't made the decision about including this in the next release or not (the code to calculate the discounted price), so to be safe, you should make a backup of that file and re-upload it if you update to latest version of Events Booking
Regards,
Tuan
Regards,
Tuan
Please Log in or Create an account to join the conversation.
- Matj
- Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 112
- Thank you received: 0
8 years 2 weeks ago #96866
by Matj
Replied by Matj on topic Price and register button in module
Can you please include this in next release.
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
8 years 2 weeks ago #96902
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Price and register button in module
We could not include everything in the core download package. So sometime, you will need to keep the customization. There should be at least 5 or 10 customers interested in the feature before we consider adding support to core download package
So for now:
1. Put your request into Features wishlish forum www.joomdonation.com/forum/events-bookin...tures-wish-list.html
2. Make a backup copy of the modified module, then each time you update Events Booking, re-install it. It is not much work thought
Tuan
So for now:
1. Put your request into Features wishlish forum www.joomdonation.com/forum/events-bookin...tures-wish-list.html
2. Make a backup copy of the modified module, then each time you update Events Booking, re-install it. It is not much work thought
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.