hi,
would it be possible to give us additional info about this, please?
-
This reply was modified 5 years, 4 months ago by
angelo_nwl.
Thread Starter
Wilson
(@willy210385)
it would be nice to have the possibility to view all my reservations and decide which ones to leave, for example: “my 4 latest reservations”
I am using it to manage reservations at meetings and therefore the participants are used to participate in these meetings, the reservation system uses it a lot
an example: [my_bookings limit=4]
I must be able to insert this code on any page
Hello,
Perhaps what you’re looking is a “My Bookings” page? You could try and create a page then select that page under Events > Settings > Pages > Other Pages > Then select the page under my bookings part.
Thread Starter
Wilson
(@willy210385)
no… I’m looking for a way to show only my last 4 bookings and not all of them
at the moment you might need to modify template file at events-manager/templates/templates/my-bookings.php
to use templates: http://wp-events-plugin.com/documentation/using-template-files/
eg. wp-content/themes/Your Theme/plugins/events-manager/templates/my-bookings.php
Thread Starter
Wilson
(@willy210385)
yes I know, in fact a little the template I have already modified it but I can’t understand what is the php code to insert to release only the last 4 reservations
can I know the code on line 15?
e.g.
$limit = ( !empty($_GET['limit']) ) ? $_GET['limit'] : 20;//Default limit
Thread Starter
Wilson
(@willy210385)
<?php do_action(’em_template_my_bookings_header’); ?>
<?php
function stonehenge_rename_booking_status( $key ) {
$status = array(
‘0’ => ‘Non pagato’,
‘1’ => ‘<font color=”#22A428″><b><font size=”5″><i class=”fas fa-thumbs-up”></i></b></font>’,
‘2’ => ‘Respinto’,
‘3’ => ‘Firmato out’,
‘4’ => ‘In attesa di pagamento online’,
‘5’ => ‘Non ancora pagato’,
);
return $status[$key];
}
global $wpdb, $current_user, $EM_Notices, $EM_Person;
if( is_user_logged_in() ):
$EM_Person = new EM_Person( get_current_user_id() );
$EM_Bookings = $EM_Person->get_bookings();
$bookings_count = count($EM_Bookings->bookings);
if($bookings_count > 0){
//Get events here in one query to speed things up
$event_ids = array();
foreach($EM_Bookings as $EM_Booking){
$event_ids[] = $EM_Booking->event_id;
}
}
$page = ( !empty($_GET[‘pno’]) ) ? $_GET[‘pno’]:1;
$offset = ( $page > 4 ) ? ($page-1)*$limit : 0;
echo $EM_Notices;
?>
…………………………continue
Sorry, at the moment you can set the limit using the above code I shared.