Price and register button in module

  • Matj
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 2 months ago #93128 by Matj
Im using Events Booking - Upcoming events module and doing some template overrides to match my needs (make it look like timeline).

Is there a way to show price, details button and register buttons?

Now i have:
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"> <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-fluid"> <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="url 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> <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><small 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></small></p> <div class="mod_eb_description"><?php echo $row->short_description; ?></div> <?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.

More
7 years 2 months ago #93149 by James Riley
Replied by James Riley on topic Price and register button in module
This is the code I use in order to add a REGISTER / MORE INFO button (really, it's the Details button with my own text hard-coded in).

Add where you want to your PHP file:
Code:
<p><span class="event_infolink"><a href="<?php echo JRoute::_(EventbookingHelperRoute::getEventRoute($row->id, 0, $itemId)); ?>" class="btn btn-primary">Register/More info</a></span></p>

Style with CSS:
Code:
div.mod_eb_event li.vevent .event_infolink .btn.btn-primary { float:right; /* change the float, or add you own declarations */ }


(note: the date/time in the sample above are also part of my override... (see my post at www.joomdonation.com/forum/events-bookin...vent-time.html#93016 for code).

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:

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

More
7 years 2 months ago - 7 years 2 months ago #93150 by James Riley
Replied by James Riley on topic Price and register button in module
PRICE:
Here's a list of all the values available in the $row-> object. $row->individual_price might be what you want.
access
activate_certificate_feature
activate_tickets_pdf
activate_waiting_list
alias
[strike]alt_group_button_text [/strike]
^ custom... only in my build
api_login
article_id
attachment
cancel_before_date
categories
category_id
certificate_bg_image
certificate_bg_left
certificate_bg_top
certificate_layout
created_by
currency_code
currency_symbol
custom_field_ids
custom_fields
cut_off_date
deposit_amount
deposit_type
description
discount
discount_amounts
discount_groups
discount_type
early_bird_discount_amount
early_bird_discount_date
early_bird_discount_type
enable_auto_reminder
enable_cancel_registration
enable_coupon
[strike]enable_terms_conditions [/strike]
^ custom... only in my build
event_capacity
event_date
event_end_date
event_password
event_type
featured
fixed_daylight_saving_time
fixed_group_price
has_multiple_ticket_types
hits
id
image
individual_price
invoice_format
is_additional_date
language
late_fee_amount
late_fee_date
late_fee_type
location_id
location_name
max_end_date
max_group_number
meta_description
meta_keywords
min_group_number
monthdays
notification_emails
number_categories
ordering
params
parent_id
payment_methods
paypal_email
price_text
published
recurring_end_date
recurring_frequency
recurring_occurrencies
recurring_type
registration_access
registration_approved_email_body
registration_form_message
registration_form_message_group
registration_handle_url
registration_start_date
registration_type
remind_before_x_days
short_description
tax_rate
thanks_message
thanks_message_offline
thumb
ticket_bg_image
ticket_bg_left
ticket_bg_top
ticket_layout
ticket_prefix
ticket_start_number
title
transaction_key
user_email_body
user_email_body_offline
weekdays

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: 7 years 2 months ago by James Riley.

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

  • Matj
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 2 months ago #93151 by Matj
Replied by Matj on topic Price and register button in module
Thank you for sugestion, but more info button i allready manage to implement. I want to copy timeline layout. I manage to do as on image.
Now i need price and register buttons/links.
Attachments:

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

More
7 years 2 months ago - 7 years 2 months ago #93152 by James Riley
Replied by James Riley on topic Price and register button in module
The code for the Register buttons is in /view/common/tmpl/buttons.php.
Search the file for JText::_('EB_REGISTER_INDIVIDUAL') and JText::_('EB_REGISTER_GROUP') to get to the right section of the file.

I think you might be able to just borrow the JRoute code from there, and replace the ID variables with the corresponding value(s?) from the $row-> object.

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: 7 years 2 months ago by James Riley.

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

  • Matj
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 2 months ago #93155 by Matj
Replied by Matj on topic Price and register button in module
You point me in right direction. I manage to show price, but only individual price. If i have text price or free, output is not ok. Must take php if statements too. Im not good in php so apriciate any help ;)

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

More
7 years 2 months ago - 7 years 2 months ago #93156 by James Riley
Replied by James Riley on topic Price and register button in module
This should be useful (from /view/common/tmpl/event_properties.php)
NOTE: Change the all the $item-> to $row-> .

PRICING:
Code:
<table><tr><td class="eb_price"> <?php if ($item->price_text) { echo $item->price_text; } elseif ($item->individual_price > 0) { echo EventbookingHelper::formatCurrency($item->individual_price, $config, $item->currency_symbol); } else { echo '<span class="eb_free">' . JText::_('EB_FREE') . '</span>'; } ?> </td></tr></table>

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: 7 years 2 months ago by James Riley.

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

  • Matj
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 2 months ago #93157 by Matj
Replied by Matj on topic Price and register button in module
That is working! Thank you!

Just register buttons and we win ;)

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

More
7 years 2 months ago - 7 years 2 months ago #93158 by James Riley
Replied by James Riley on topic Price and register button in module
Also from the same file (again, change $item to $row):

FIXED GROUP PRICING:
Code:
if ($item->fixed_group_price > 0) { ?> <tr> <td> <strong><?php echo JText::_('EB_FIXED_GROUP_PRICE'); ?></strong> </td> <td class="eb_price"> <?php echo EventbookingHelper::formatCurrency($item->fixed_group_price, $config, $item->currency_symbol); ?> </td> </tr> <?php }

Haven't found code for non-fixed GROUP PRICING yet... Do you need Group pricing or just individual?

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: 7 years 2 months ago by James Riley.

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

  • Matj
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 2 months ago #93159 by Matj
Replied by Matj on topic Price and register button in module
For now individual will do.

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

Moderators: Tuan Pham Ngoc