WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] again #_BOOKINGBUTTON (7 posts)

  1. friedhelm
    Member
    Posted 1 year ago #

    dear forum

    if the user is logged in and booked the last ticket, the logged in user cant cancel the booking because there will be no cancel button..

    but we need one, is there a posibility? (a _Cancelbutton ?)

    dokumentation:
    "A single button that will appear to logged in users, if they click on it, they apply for a booking. This button will only display if there is one ticket."

    thanks a lot

    http://wordpress.org/extend/plugins/events-manager/

  2. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    if they visit the events/my-bookings page (or similar if you renamed it), do they see a link to cancel?

    Also, do you have the option to allow users to cancel in your Events > Settings > Bookings > General Options?

  3. friedhelm
    Member
    Posted 1 year ago #

    here is the link for our bookingpage, i made it as a template.

    in the original bookingbutton.php there is only a message that the course full is, no possibility to cancel the course for a loggedin user, so i tried this:

    the last few lines in the script:

    <?php elseif( $EM_Event->get_bookings()->get_available_spaces() <= 0 ): ?>
    <?php $Current_user_booking_id = $EM_Event->get_bookings()->has_booking(get_current_user_id())->booking_id; ?>
    <?php //echo ($Current_user_booking_id) ?>
    <a id="em-cancel-button_<?php echo $Current_user_booking_id; ?>_<?php echo wp_create_nonce('booking_cancel'); ?>" class="button em-cancel-button"><?php echo $button_cancel; ?></a>
    <span class="em-full-button"><?php //echo $notice_full ?></span>
    <?php endif; ?>

    ps: i hope i found the right "backticks"

  4. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    I get redirected to your homepage, so I don't see the buttons on your site.

    however, are you sure you're using an up-to-date version of EM? Looking into this we do have a cancel button and have had it for a while now.

    If booked, it should show up as a cancel button, provided you enable cancellations in your Settings > Bookings > General Options

  5. friedhelm
    Member
    Posted 1 year ago #

    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 != 3means?

    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 !

  6. friedhelm
    Member
    Posted 1 year ago #

    sorry, there is a little mistake in the script:

    instead of $EM_Booking->booking_id it should be $Current_user_booking_id!

    <?php if ($Current_user_booking_id) : ?>
    <a id="em-cancel-button_<?php echo $Current_user_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; ?>
  7. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    i see what you mean, if the event is fully booked it always skips to the fully booked message regardless of whether the user booked or not.

    will fix asap.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.