here are my settings:
1. settings > bookings > general Options >Can users cancel their booking? > yes.
2. settings > bookings > general Options >Allow double bookings? > no.
i am using version em Version 5.3.5,
emp Version 2.2.8.
i made a testcourse with two spaces and reserved this course with two different logged-in customers.
if the last customer loggs in and tries to canel his course he gets the message: “Sold Out” but no cancel-button.
in my template i use $EM_Event->output('#_BOOKINGBUTTON')
, so i think this calls the “bookingbutton.php”.
therefore i copied the file “bookingbutton.php” from its originalplace in
plug-ins/events-manager/templates/placeholders to:
mytheme/plug-ins/events-manager/placeholders.
in “bookingbutton.php” i found in line 31 <?php echo $notice_full ?>
witch gives me the “Sold Out” message.
but in my case it should go to line 25 <?php echo $button_cancel; ?>
to give me the cancel-button. here the scripts looks for double-booking (dbem_bookings_double) and if the user is allowed to cancel bookings (dbem_bookings_user_cancellation), but i dont know what $EM_Booking->status != 3
means?
so i commented line 31 out and tried to find out if the logged-in user has a corresponding booking_id (even the course is fully booked):
<?php $Current_user_booking_id = $EM_Event->get_bookings()->has_booking(get_current_user_id())->booking_id; ?>
and if so show a cancel-button:
<?php if ($Current_user_booking_id) : ?>
<a id="em-cancel-button_<?php echo $EM_Booking->booking_id; ?>_<?php echo wp_create_nonce('booking_cancel'); ?>" class="button em-cancel-button"><?php echo $button_cancel; ?></a>
<?php else: ?>
<span class="em-full-button"><?php echo $notice_full ?></span>
<?php endif; ?>
this work for me, but i think it could be made between line 24 and 26?
thanks a lot !