Hi rakeshy
Here is the code I use in my project.
Uncomment:
to view what you have in the array from the SQL-query.
For each ticket you need to set 'Number of seats' in RSevents back-end.
In my project I would like to show the price including VAT, that's why I use this: '$ticket->price*1.25'. You need to fit it your project.
And you need to add 'COM_RSEVENTSPRO_EVENT_AVAILABLE_SEATS_SINGULAR' and 'COM_RSEVENTSPRO_EVENT_AVAILABLE_SEATS_PLURAL' to your Joomla language override files.
Regards,
Henrik
<!--// start / Event price -->
<?php if (isset($details['ticket_info'])) { // If event has tickets
// Get ticket names, ticket prices and available seats for each ticket
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->clear()
->select($db->qn('t.name'))->select($db->qn('t.price'))->select($db->qn('t.seats'))->select($db->qn('t.user_seats'))->select($db->qn('t.description'))->select('sum('.$db->qn('u.quantity').') AS subscriptions')
->from($db->qn('#__rseventspro_tickets', 't'))
->join('LEFT', $db->qn('#__rseventspro_user_tickets', 'u') . ' ON (' . $db->qn('u.idt') . ' = ' . $db->qn('t.id') . ')')
->where($db->qn('t.ide') . ' = ' . $event->id)
->group($db->qn('t.id'))
->order($db->qn('t.id') . ' ASC');
$db->setQuery($query);
$tickets = $db->loadObjectList();
//var_dump($tickets);
?>
<div class="rsep_price">
<?php
if($tickets) {
foreach ($tickets as $ticket) {
echo "<span><small>" . $ticket->name . " </small>";
//if (strpos($categories,'somecategory')) { // show available tickets, if Event Category is 'somecategory'
$available_tickets = $ticket->seats - $ticket->subscriptions;
if ($available_tickets == 1) {
echo "<small>(" . $available_tickets . " " . JText::_('COM_RSEVENTSPRO_EVENT_AVAILABLE_SEATS_SINGULAR') . ")</small>";
} elseif ($available_tickets > 1) {
echo "<small>(" . $available_tickets . " " . JText::_('COM_RSEVENTSPRO_EVENT_AVAILABLE_SEATS_PLURAL') . ")</small>";
}
//}
if ($ticket->price != 0.000) { // Don't show if it's a free ticket
echo "<br /><strong>" . rseventsproHelper::convertprice($ticket->price*1.25) . "</strong><small> " . rseventsproHelper::getConfig('payment_currency_sign') . "</small>";
}
if (!empty($ticket->description)) {
echo "<br /><small style='display:inline-block;'>" . $ticket->description . " </small>";
}
echo "</span>";
}
}
?>
</div>
<?php } // end - If event has tickets ?>
<!--// start / Event price -->